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> 37e1bac94cSAndre Fischer #include <sfx2/sidebar/Tools.hxx> 38766ce4d0SZheng Fan #include <svx/sidebar/PopupContainer.hxx> 39766ce4d0SZheng Fan #include <sfx2/dispatch.hxx> 40766ce4d0SZheng Fan #include <editeng/colritem.hxx> 41766ce4d0SZheng Fan #include <editeng/brshitem.hxx> 42766ce4d0SZheng Fan #include <editeng/lrspitem.hxx> 43766ce4d0SZheng Fan #include <editeng/ulspitem.hxx> 44766ce4d0SZheng Fan #include <vcl/toolbox.hxx> 45766ce4d0SZheng Fan #include <vcl/fixed.hxx> 46766ce4d0SZheng Fan #include <vcl/svapp.hxx> 47766ce4d0SZheng Fan #include <svx/svxids.hrc> 48766ce4d0SZheng Fan #include <svl/intitem.hxx> 49766ce4d0SZheng Fan #include "svx/dialmgr.hxx" 50766ce4d0SZheng Fan #include <sfx2/objsh.hxx> 51766ce4d0SZheng Fan #include <svtools/unitconv.hxx> 52766ce4d0SZheng Fan #include <boost/bind.hpp> 53766ce4d0SZheng Fan using namespace css; 54766ce4d0SZheng Fan using namespace cssu; 55766ce4d0SZheng Fan using ::sfx2::sidebar::Theme; 56766ce4d0SZheng Fan using ::sfx2::sidebar::ControlFactory; 57766ce4d0SZheng Fan 58766ce4d0SZheng Fan namespace svx {namespace sidebar { 59766ce4d0SZheng Fan #define DEFAULT_VALUE 0 60766ce4d0SZheng Fan #define TOOLBOX_ITEM1 1 61766ce4d0SZheng Fan #define TOOLBOX_ITEM2 2 62766ce4d0SZheng Fan #define TOOLBOX_ITEM3 3 63766ce4d0SZheng Fan #define TOOLBOX_ITEM4 4 64766ce4d0SZheng Fan 65766ce4d0SZheng Fan #define MAX_DURCH 5670 66766ce4d0SZheng Fan 67766ce4d0SZheng Fan #define INDENT_INCREMENT 1 68766ce4d0SZheng Fan #define INDENT_DECREMENT 2 69766ce4d0SZheng Fan #define INDENT_STEP 706 70766ce4d0SZheng Fan #define UL_STEP 58 71766ce4d0SZheng Fan 72766ce4d0SZheng Fan #define NEGATIVE_MAX_VALUE -9999 73766ce4d0SZheng Fan #define BEGIN_VALUE 28 74766ce4d0SZheng Fan #define MAX_SW 1709400 75766ce4d0SZheng Fan #define MAX_SC_SD 116220200 76766ce4d0SZheng Fan #define NEGA_MAXVALUE -10000000 77766ce4d0SZheng Fan 78766ce4d0SZheng Fan #define POS_FT_PARA_SPACE Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y), MAP_APPFONT)) 79766ce4d0SZheng Fan #define POS_FT_PARA_SPACE2 Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y2), MAP_APPFONT)) 80766ce4d0SZheng 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)) 81766ce4d0SZheng 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)) 82766ce4d0SZheng Fan #define POS_FT_PARA_INDENT Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y), MAP_APPFONT)) 83766ce4d0SZheng Fan #define POS_FT_PARA_INDENT2 Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y2), MAP_APPFONT)) 84766ce4d0SZheng 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)) 85766ce4d0SZheng 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)) 86766ce4d0SZheng Fan #define POS_MBX_TOP_DIST Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y), MAP_APPFONT)) 87766ce4d0SZheng Fan #define POS_MBX_TOP_DIST2 Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y2), MAP_APPFONT)) 88766ce4d0SZheng Fan #define POS_MBX_BOT_DIST Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y), MAP_APPFONT)) 89766ce4d0SZheng Fan #define POS_MBX_BOT_DIST2 Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y2), MAP_APPFONT)) 90766ce4d0SZheng Fan #define POS_MBX_LEFT_DIST Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y), MAP_APPFONT)) 91766ce4d0SZheng Fan #define POS_MBX_LEFT_DIST2 Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y2), MAP_APPFONT)) 92766ce4d0SZheng Fan #define POS_MBX_RIGHT_DIST Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y), MAP_APPFONT)) 93766ce4d0SZheng Fan #define POS_MBX_RIGHT_DIST2 Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y2), MAP_APPFONT)) 94766ce4d0SZheng Fan #define POS_MBX_FLINE_DIST Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y), MAP_APPFONT)) 95766ce4d0SZheng Fan #define POS_MBX_FLINE_DIST2 Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y2), MAP_APPFONT)) 96766ce4d0SZheng Fan #define POS_IMG_SPACE1 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y), MAP_APPFONT)) 97766ce4d0SZheng Fan #define POS_IMG_SPACE12 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y2), MAP_APPFONT)) 98766ce4d0SZheng Fan #define POS_IMG_SPACE2 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y), MAP_APPFONT)) 99766ce4d0SZheng Fan #define POS_IMG_SPACE22 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y2), MAP_APPFONT)) 100766ce4d0SZheng Fan #define POS_IMG_INDENT1 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y), MAP_APPFONT)) 101766ce4d0SZheng Fan #define POS_IMG_INDENT12 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y2), MAP_APPFONT)) 102766ce4d0SZheng Fan #define POS_IMG_INDENT2 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y), MAP_APPFONT)) 103766ce4d0SZheng Fan #define POS_IMG_INDENT22 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y2), MAP_APPFONT)) 104766ce4d0SZheng Fan #define POS_IMG_INDENT3 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y), MAP_APPFONT)) 105766ce4d0SZheng Fan #define POS_IMG_INDENT32 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y2), MAP_APPFONT)) 106766ce4d0SZheng Fan #define TBX_LINE_SPACE Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y), MAP_APPFONT)) 107766ce4d0SZheng Fan #define TBX_LINE_SPACE2 Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y2), MAP_APPFONT)) 108766ce4d0SZheng Fan 109766ce4d0SZheng Fan #define LINE_POINT1_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y), MAP_APPFONT)) 110766ce4d0SZheng Fan #define LINE_POINT2_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y), MAP_APPFONT)) 111766ce4d0SZheng Fan #define LINE_POINT3_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y2), MAP_APPFONT)) 112766ce4d0SZheng Fan #define LINE_POINT4_WHITE Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y2), MAP_APPFONT)) 113766ce4d0SZheng Fan 114766ce4d0SZheng Fan ParaPropertyPanel* ParaPropertyPanel::Create ( 115766ce4d0SZheng Fan Window* pParent, 116766ce4d0SZheng Fan const cssu::Reference<css::frame::XFrame>& rxFrame, 11737fee4fdSAndre Fischer SfxBindings* pBindings, 11837fee4fdSAndre Fischer const cssu::Reference<css::ui::XSidebar>& rxSidebar) 119766ce4d0SZheng Fan { 120766ce4d0SZheng Fan if (pParent == NULL) 121766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no parent Window given to ParaPropertyPanel::Create"), NULL, 0); 122766ce4d0SZheng Fan if ( ! rxFrame.is()) 123766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no XFrame given to ParaPropertyPanel::Create"), NULL, 1); 124766ce4d0SZheng Fan if (pBindings == NULL) 125766ce4d0SZheng Fan throw lang::IllegalArgumentException(A2S("no SfxBindings given to ParaPropertyPanel::Create"), NULL, 2); 126766ce4d0SZheng Fan 127766ce4d0SZheng Fan return new ParaPropertyPanel( 128766ce4d0SZheng Fan pParent, 129766ce4d0SZheng Fan rxFrame, 13037fee4fdSAndre Fischer pBindings, 13137fee4fdSAndre Fischer rxSidebar); 132766ce4d0SZheng Fan } 133766ce4d0SZheng Fan 134766ce4d0SZheng Fan void ParaPropertyPanel::HandleContextChange ( 135766ce4d0SZheng Fan const ::sfx2::sidebar::EnumContext aContext) 136766ce4d0SZheng Fan { 137766ce4d0SZheng Fan if (maContext == aContext) 138766ce4d0SZheng Fan { 139766ce4d0SZheng Fan // Nothing to do. 140766ce4d0SZheng Fan return; 141766ce4d0SZheng Fan } 142766ce4d0SZheng Fan 143766ce4d0SZheng Fan maContext = aContext; 14437fee4fdSAndre Fischer switch (maContext.GetCombinedContext_DI()) 145766ce4d0SZheng Fan { 146766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_DrawText): 147*b6ab65a3SAndre Fischer mpTBxVertAlign->Show(); 148*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Show(); 149*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 150*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 151*b6ab65a3SAndre Fischer mpTBxNumBullet->Hide(); 152*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Hide(); 15337fee4fdSAndre Fischer ReSize(false); 154*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 155*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Show(); 156*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 157*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Hide(); 15837fee4fdSAndre Fischer break; 15937fee4fdSAndre Fischer 16037fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Draw): 16137fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 16237fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 163*b6ab65a3SAndre Fischer mpTBxVertAlign->Hide(); 164*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Hide(); 165*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 166*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 167*b6ab65a3SAndre Fischer mpTBxNumBullet->Show(); 168*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Show(); 16937fee4fdSAndre Fischer ReSize(true); 170*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Hide(); 171*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Hide(); 172*b6ab65a3SAndre Fischer mpTbxProDemote->Show(); 173*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Show(); 17437fee4fdSAndre Fischer break; 17537fee4fdSAndre Fischer 17637fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 177*b6ab65a3SAndre Fischer mpTBxVertAlign->Show(); 178*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Show(); 179*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 180*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 181*b6ab65a3SAndre Fischer mpTBxNumBullet->Show(); 182*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Show(); 18337fee4fdSAndre Fischer ReSize(true); 184*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Hide(); 185*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Hide(); 186*b6ab65a3SAndre Fischer mpTbxProDemote->Show(); 187*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Show(); 18837fee4fdSAndre Fischer break; 18937fee4fdSAndre Fischer 19037fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Table): 191*b6ab65a3SAndre Fischer mpTBxVertAlign->Show(); 192*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Show(); 193*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 194*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 195*b6ab65a3SAndre Fischer mpTBxNumBullet->Show(); 196*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Show(); 19737fee4fdSAndre Fischer ReSize(true); 198*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Hide(); 199*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Hide(); 200*b6ab65a3SAndre Fischer mpTbxProDemote->Show(); 201*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Show(); 20237fee4fdSAndre Fischer break; 20337fee4fdSAndre Fischer 20485f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Default): 20585f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Text): 206*b6ab65a3SAndre Fischer mpTBxVertAlign->Hide(); 207*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Hide(); 208*b6ab65a3SAndre Fischer mpTBxBackColor->Show(); 209*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Show(); 210*b6ab65a3SAndre Fischer mpTBxNumBullet->Show(); 211766ce4d0SZheng Fan 212*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Show(); 21337fee4fdSAndre Fischer ReSize(true); 214*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 215*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Show(); 216*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 217*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Hide(); 21837fee4fdSAndre Fischer break; 21937fee4fdSAndre Fischer 22085f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Table): 221*b6ab65a3SAndre Fischer mpTBxVertAlign->Show(); 222*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Show(); 223*b6ab65a3SAndre Fischer mpTBxBackColor->Show(); 224*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Show(); 225*b6ab65a3SAndre Fischer mpTBxNumBullet->Show(); 226*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Show(); 22737fee4fdSAndre Fischer ReSize(true); 228*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 229*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Show(); 230*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 231*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Hide(); 23237fee4fdSAndre Fischer break; 23337fee4fdSAndre Fischer 23485f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 235*b6ab65a3SAndre Fischer mpTBxVertAlign->Show(); 236*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Show(); 237*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 238*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 239*b6ab65a3SAndre Fischer mpTBxNumBullet->Hide(); 240*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Hide(); 24137fee4fdSAndre Fischer ReSize(false); 242*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 243*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Show(); 244*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 245*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Hide(); 24637fee4fdSAndre Fischer break; 24737fee4fdSAndre Fischer 24885f1aca2SAndre Fischer case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 249*b6ab65a3SAndre Fischer mpTBxVertAlign->Hide(); 250*b6ab65a3SAndre Fischer mpTBxVertAlignBackground->Hide(); 251*b6ab65a3SAndre Fischer mpTBxBackColor->Hide(); 252*b6ab65a3SAndre Fischer mpTBxBackColorBackground->Hide(); 253*b6ab65a3SAndre Fischer mpTBxNumBullet->Hide(); 254*b6ab65a3SAndre Fischer mpTBxNumBulletBackground->Hide(); 25537fee4fdSAndre Fischer ReSize(false); 256*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 257*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground->Show(); 258*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 259*b6ab65a3SAndre Fischer mpTbxProDemoteBackground->Hide(); 26037fee4fdSAndre Fischer break; 26137fee4fdSAndre Fischer 262766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_EditCell): 263766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_Cell): 264766ce4d0SZheng Fan case CombinedEnumContext(Application_Calc, Context_Pivot): 26537fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_Text): 26637fee4fdSAndre Fischer case CombinedEnumContext(Application_DrawImpress, Context_OutlineText): 267766ce4d0SZheng Fan /*{ 268766ce4d0SZheng Fan mpToolBoxScriptSw->Hide(); 269766ce4d0SZheng Fan mpToolBoxScript->Show(); 270766ce4d0SZheng Fan mpToolBoxSpacing->Show(); 271766ce4d0SZheng Fan mpToolBoxHighlight->Hide(); 272766ce4d0SZheng Fan 273766ce4d0SZheng Fan Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT); 274766ce4d0SZheng Fan aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) ); 275766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 276766ce4d0SZheng Fan SetSizePixel(aSize); 277766ce4d0SZheng Fan }*/ 27837fee4fdSAndre Fischer break; 279766ce4d0SZheng Fan 280766ce4d0SZheng Fan default: 281766ce4d0SZheng Fan break; 282766ce4d0SZheng Fan } 283766ce4d0SZheng Fan } 284766ce4d0SZheng Fan 285766ce4d0SZheng Fan SfxBindings* ParaPropertyPanel::GetBindings() 286766ce4d0SZheng Fan { 287766ce4d0SZheng Fan return mpBindings; 288766ce4d0SZheng Fan } 289766ce4d0SZheng Fan 2903cac12cfSAndre Fischer 2913cac12cfSAndre Fischer 292766ce4d0SZheng Fan 293766ce4d0SZheng Fan void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent) 294766ce4d0SZheng Fan { 295766ce4d0SZheng Fan (void)rEvent; 296766ce4d0SZheng Fan } 297766ce4d0SZheng Fan 298766ce4d0SZheng Fan ParaPropertyPanel::~ParaPropertyPanel() 299766ce4d0SZheng Fan { 300766ce4d0SZheng Fan delete mpLnSPItem; 301766ce4d0SZheng Fan } 302766ce4d0SZheng Fan 303766ce4d0SZheng Fan void ParaPropertyPanel::ReSize(bool bSize) 304766ce4d0SZheng Fan { 305766ce4d0SZheng Fan if(bSize) 306766ce4d0SZheng Fan { 307766ce4d0SZheng Fan //Paragraph spacing 308*b6ab65a3SAndre Fischer mpFTUL->SetPosPixel(POS_FT_PARA_SPACE); 309*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC); 310*b6ab65a3SAndre Fischer mpTopDist->SetPosPixel(POS_MBX_TOP_DIST); 311*b6ab65a3SAndre Fischer mpBottomDist->SetPosPixel(POS_MBX_BOT_DIST); 312766ce4d0SZheng Fan //Indent 313*b6ab65a3SAndre Fischer mpFTIndent->SetPosPixel(POS_FT_PARA_INDENT); 314*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); 315*b6ab65a3SAndre Fischer mpTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); 316*b6ab65a3SAndre Fischer mpLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST); 317*b6ab65a3SAndre Fischer mpRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST); 318*b6ab65a3SAndre Fischer mpFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST); 319766ce4d0SZheng Fan //Line spacing 320*b6ab65a3SAndre Fischer mpLineSPTbx->SetPosPixel(TBX_LINE_SPACE); 321766ce4d0SZheng Fan //image 322766ce4d0SZheng Fan maFISpace1.SetPosPixel(POS_IMG_SPACE1); 323766ce4d0SZheng Fan maFISpace2.SetPosPixel(POS_IMG_SPACE2); 324766ce4d0SZheng Fan maFIndent1.SetPosPixel(POS_IMG_INDENT1); 325766ce4d0SZheng Fan maFIndent2.SetPosPixel(POS_IMG_INDENT2); 326766ce4d0SZheng Fan maFIndent3.SetPosPixel(POS_IMG_INDENT3); 327766ce4d0SZheng Fan Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT); 328766ce4d0SZheng Fan aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 329766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 330766ce4d0SZheng Fan SetSizePixel(aSize); 331766ce4d0SZheng Fan } 332766ce4d0SZheng Fan else 333766ce4d0SZheng Fan { 334766ce4d0SZheng Fan //Paragraph spacing 335*b6ab65a3SAndre Fischer mpFTUL->SetPosPixel(POS_FT_PARA_SPACE2); 336*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC2); 337*b6ab65a3SAndre Fischer mpTopDist->SetPosPixel(POS_MBX_TOP_DIST2); 338*b6ab65a3SAndre Fischer mpBottomDist->SetPosPixel(POS_MBX_BOT_DIST2); 339766ce4d0SZheng Fan //Indent 340*b6ab65a3SAndre Fischer mpFTIndent->SetPosPixel(POS_FT_PARA_INDENT2); 341*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); 342*b6ab65a3SAndre Fischer mpTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); 343*b6ab65a3SAndre Fischer mpLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST2); 344*b6ab65a3SAndre Fischer mpRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST2); 345*b6ab65a3SAndre Fischer mpFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST2); 346766ce4d0SZheng Fan //Line spacing 347*b6ab65a3SAndre Fischer mpLineSPTbx->SetPosPixel(TBX_LINE_SPACE2); 348766ce4d0SZheng Fan //image 349766ce4d0SZheng Fan maFISpace1.SetPosPixel(POS_IMG_SPACE12); 350766ce4d0SZheng Fan maFISpace2.SetPosPixel(POS_IMG_SPACE22); 351766ce4d0SZheng Fan maFIndent1.SetPosPixel(POS_IMG_INDENT12); 352766ce4d0SZheng Fan maFIndent2.SetPosPixel(POS_IMG_INDENT22); 353766ce4d0SZheng Fan maFIndent3.SetPosPixel(POS_IMG_INDENT32); 354766ce4d0SZheng Fan Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT_2); 355766ce4d0SZheng Fan aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 356766ce4d0SZheng Fan aSize.setWidth(GetOutputSizePixel().Width()); 357766ce4d0SZheng Fan SetSizePixel(aSize); 358766ce4d0SZheng Fan } 35937fee4fdSAndre Fischer 36037fee4fdSAndre Fischer if (mxSidebar.is()) 36137fee4fdSAndre Fischer mxSidebar->requestLayout(); 362766ce4d0SZheng Fan } 363766ce4d0SZheng Fan 364766ce4d0SZheng Fan void ParaPropertyPanel::EndSpacingPopupMode (void) 365766ce4d0SZheng Fan { 366766ce4d0SZheng Fan maLineSpacePopup.Hide(); 367766ce4d0SZheng Fan } 368766ce4d0SZheng Fan 369766ce4d0SZheng Fan void ParaPropertyPanel::EndBulletsPopupMode (void) 370766ce4d0SZheng Fan { 3718a9f1ce2SZheng Fan //i122054, Missed following line, for collapse the bullets popup 3728a9f1ce2SZheng Fan maBulletsPopup.Hide(); 373766ce4d0SZheng Fan } 374766ce4d0SZheng Fan 375766ce4d0SZheng Fan void ParaPropertyPanel::EndNumberingPopupMode (void) 376766ce4d0SZheng Fan { 3778a9f1ce2SZheng Fan //i122054, Missed following line, for collapse the numbering popup 3788a9f1ce2SZheng Fan maNumberingPopup.Hide(); 379766ce4d0SZheng Fan } 380766ce4d0SZheng Fan 381766ce4d0SZheng Fan 382766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxAlign() 383766ce4d0SZheng Fan { 3843cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 385*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemImage(TOOLBOX_ITEM1, maLeftAlignControl.GetIcon(bIsHighContrastModeActive)); 386*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemImage(TOOLBOX_ITEM2, maCenterAlignControl.GetIcon(bIsHighContrastModeActive)); 387*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemImage(TOOLBOX_ITEM3, maRightAlignControl.GetIcon(bIsHighContrastModeActive)); 388*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemImage(TOOLBOX_ITEM4, maJustifyAlignControl.GetIcon(bIsHighContrastModeActive)); 3893cac12cfSAndre Fischer 390766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, AlignStyleModifyHdl_Impl ); 391*b6ab65a3SAndre Fischer mpAlignToolBox->SetSelectHdl( aLink ); 392*b6ab65a3SAndre Fischer Size aTbxSize (mpAlignToolBox->CalcWindowSizePixel()); 393*b6ab65a3SAndre Fischer mpAlignToolBox->SetOutputSizePixel( aTbxSize ); 394766ce4d0SZheng Fan } 395766ce4d0SZheng Fan 396766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxVertAlign() 397766ce4d0SZheng Fan { 3983cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 399*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemImage(IID_VERT_TOP, maVertTop.GetIcon(bIsHighContrastModeActive)); 400*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemImage(IID_VERT_CENTER, maVertCenter.GetIcon(bIsHighContrastModeActive)); 401*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemImage(IID_VERT_BOTTOM, maVertBottom.GetIcon(bIsHighContrastModeActive)); 402*b6ab65a3SAndre Fischer mpTBxVertAlign->SetSelectHdl(LINK(this,ParaPropertyPanel,VertTbxSelectHandler)); 403*b6ab65a3SAndre Fischer Size aTbxSize (mpTBxVertAlign->CalcWindowSizePixel()); 404*b6ab65a3SAndre Fischer mpTBxVertAlign->SetOutputSizePixel( aTbxSize ); 405766ce4d0SZheng Fan } 406766ce4d0SZheng Fan 407766ce4d0SZheng Fan 408766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxIndent() 409766ce4d0SZheng Fan { 410766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ModifyIndentHdl_Impl ); 411*b6ab65a3SAndre Fischer mpLeftIndent->SetModifyHdl( aLink ); 412*b6ab65a3SAndre Fischer mpRightIndent->SetModifyHdl( aLink ); 413*b6ab65a3SAndre Fischer mpFLineIndent->SetModifyHdl( aLink ); 414766ce4d0SZheng Fan 415*b6ab65a3SAndre Fischer mpLeftIndent->SetAccessibleName(mpLeftIndent->GetQuickHelpText()); 416*b6ab65a3SAndre Fischer mpRightIndent->SetAccessibleName(mpRightIndent->GetQuickHelpText()); 417*b6ab65a3SAndre Fischer mpFLineIndent->SetAccessibleName(mpFLineIndent->GetQuickHelpText()); 4185dda62ceSAndre Fischer 4193cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 4203cac12cfSAndre Fischer 421766ce4d0SZheng Fan if( Application::GetSettings().GetLayoutRTL()) 422766ce4d0SZheng Fan { 423*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon(bIsHighContrastModeActive)); 424*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon(bIsHighContrastModeActive)); 425766ce4d0SZheng Fan } 426766ce4d0SZheng Fan else 427766ce4d0SZheng Fan { 428*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon(bIsHighContrastModeActive)); 429*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon(bIsHighContrastModeActive)); 430766ce4d0SZheng Fan } 431*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM3,maIndHang); 432766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl ); 433*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetSelectHdl(aLink); 434766ce4d0SZheng Fan m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); 435*b6ab65a3SAndre Fischer Size aTbxSize = mpTbxIndent_IncDec->CalcWindowSizePixel(); 436*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetOutputSizePixel( aTbxSize ); 437766ce4d0SZheng Fan 438766ce4d0SZheng Fan if( Application::GetSettings().GetLayoutRTL()) 439766ce4d0SZheng Fan { 440*b6ab65a3SAndre Fischer mpTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon(bIsHighContrastModeActive)); 441*b6ab65a3SAndre Fischer mpTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon(bIsHighContrastModeActive)); 442766ce4d0SZheng Fan } 443766ce4d0SZheng Fan else 444766ce4d0SZheng Fan { 445*b6ab65a3SAndre Fischer mpTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon(bIsHighContrastModeActive)); 446*b6ab65a3SAndre Fischer mpTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon(bIsHighContrastModeActive)); 447766ce4d0SZheng Fan } 448*b6ab65a3SAndre Fischer mpTbxProDemote->SetItemImage(TOOLBOX_ITEM3,maIndHang); 449766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickProDemote_Hdl_Impl ); 450*b6ab65a3SAndre Fischer mpTbxProDemote->SetSelectHdl(aLink); 451766ce4d0SZheng Fan m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); 452*b6ab65a3SAndre Fischer aTbxSize = mpTbxProDemote->CalcWindowSizePixel(); 453*b6ab65a3SAndre Fischer mpTbxProDemote->SetOutputSizePixel( aTbxSize ); 454766ce4d0SZheng Fan } 455766ce4d0SZheng Fan 456766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxBGColor() 457766ce4d0SZheng Fan { 458*b6ab65a3SAndre Fischer mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, mpTBxBackColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW )); 459766ce4d0SZheng Fan 460*b6ab65a3SAndre Fischer mpTBxBackColor->SetItemImage(TBI_BACK_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor); 461*b6ab65a3SAndre Fischer mpTBxBackColor->SetItemBits( TBI_BACK_COLOR, mpTBxBackColor->GetItemBits( TBI_BACK_COLOR ) | TIB_DROPDOWNONLY ); 462766ce4d0SZheng Fan 463766ce4d0SZheng Fan Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler); 464*b6ab65a3SAndre Fischer mpTBxBackColor->SetDropdownClickHdl ( aLink ); 465*b6ab65a3SAndre Fischer mpTBxBackColor->SetSelectHdl ( aLink ); 466*b6ab65a3SAndre Fischer Size aTbxSize (mpTBxBackColor->CalcWindowSizePixel()); 467*b6ab65a3SAndre Fischer mpTBxBackColor->SetOutputSizePixel( aTbxSize ); 468766ce4d0SZheng Fan } 469766ce4d0SZheng Fan 470766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxBulletsNumbering() 471766ce4d0SZheng Fan { 4723cac12cfSAndre Fischer const bool bIsHighContrastModeActive (Theme::IsHighContrastMode()); 473*b6ab65a3SAndre Fischer mpTBxNumBullet->SetItemImage(IID_BULLET, maBulletOnOff.GetIcon(bIsHighContrastModeActive)); 474*b6ab65a3SAndre Fischer mpTBxNumBullet->SetItemImage(IID_NUMBER, maNumberOnOff.GetIcon(bIsHighContrastModeActive)); 475766ce4d0SZheng Fan 476*b6ab65a3SAndre Fischer mpTBxNumBullet->SetDropdownClickHdl(LINK(this,ParaPropertyPanel,NumBTbxDDHandler)); 477*b6ab65a3SAndre Fischer mpTBxNumBullet->SetSelectHdl(LINK(this,ParaPropertyPanel,NumBTbxSelectHandler)); 478*b6ab65a3SAndre Fischer Size aTbxSize (mpTBxNumBullet->CalcWindowSizePixel()); 479*b6ab65a3SAndre Fischer mpTBxNumBullet->SetOutputSizePixel( aTbxSize ); 480766ce4d0SZheng Fan } 481766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxSpacing() 482766ce4d0SZheng Fan { 483766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ULSpaceHdl_Impl ); 484*b6ab65a3SAndre Fischer mpTopDist->SetModifyHdl(aLink); 485*b6ab65a3SAndre Fischer mpBottomDist->SetModifyHdl( aLink ); 486766ce4d0SZheng Fan 487*b6ab65a3SAndre Fischer mpTopDist->SetAccessibleName(mpTopDist->GetQuickHelpText()); 488*b6ab65a3SAndre Fischer mpBottomDist->SetAccessibleName(mpBottomDist->GetQuickHelpText()); 4895dda62ceSAndre Fischer 490e1bac94cSAndre Fischer // Use a form of image loading that can handle both .uno:<command> 491e1bac94cSAndre Fischer // and private:graphirepository... syntax. This is necessary to 492e1bac94cSAndre Fischer // handle the workaround for accessing the images of commands 493e1bac94cSAndre Fischer // ParaspaceIncrease and ParaspaceDecrease. 494e1bac94cSAndre Fischer // See issue 122446 for more details. 495*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetItemImage( 496e1bac94cSAndre Fischer BT_TBX_UL_INC, 497*b6ab65a3SAndre Fischer sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(BT_TBX_UL_INC), mxFrame)); 498*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetItemImage( 499e1bac94cSAndre Fischer BT_TBX_UL_DEC, 500*b6ab65a3SAndre Fischer sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(BT_TBX_UL_DEC), mxFrame)); 501e1bac94cSAndre Fischer 502766ce4d0SZheng Fan aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl ); 503*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetSelectHdl(aLink); 504766ce4d0SZheng Fan m_eULSpaceUnit = maULSpaceControl.GetCoreMetric(); 505*b6ab65a3SAndre Fischer Size aTbxSize = mpTbxUL_IncDec->CalcWindowSizePixel(); 506*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetOutputSizePixel( aTbxSize ); 507766ce4d0SZheng Fan } 508766ce4d0SZheng Fan void ParaPropertyPanel::InitToolBoxLineSpacing() 509766ce4d0SZheng Fan { 510766ce4d0SZheng Fan Link aLink = LINK( this, ParaPropertyPanel, ClickLineSPDropDownHdl_Impl ); 511*b6ab65a3SAndre Fischer mpLineSPTbx->SetDropdownClickHdl( aLink ); 512*b6ab65a3SAndre Fischer mpLineSPTbx->SetSelectHdl( aLink ); //support keyinput "ENTER" 513*b6ab65a3SAndre Fischer mpLineSPTbx->SetItemBits( TOOLBOX_ITEM1, mpLineSPTbx->GetItemBits( TOOLBOX_ITEM1 ) | TIB_DROPDOWNONLY ); 514*b6ab65a3SAndre Fischer mpLineSPTbx->SetItemImage(TOOLBOX_ITEM1,maSpace3); 515*b6ab65a3SAndre Fischer Size aTbxSize = mpLineSPTbx->CalcWindowSizePixel(); 516*b6ab65a3SAndre Fischer mpLineSPTbx->SetOutputSizePixel( aTbxSize ); 517766ce4d0SZheng Fan } 518766ce4d0SZheng Fan 519766ce4d0SZheng Fan void ParaPropertyPanel::initial() 520766ce4d0SZheng Fan { 521*b6ab65a3SAndre Fischer mpFTUL->SetBackground(Wallpaper()); 522*b6ab65a3SAndre Fischer mpFTIndent->SetBackground(Wallpaper()); 52337fee4fdSAndre Fischer maFISpace1.SetBackground(Wallpaper()); 52437fee4fdSAndre Fischer maFISpace2.SetBackground(Wallpaper()); 52537fee4fdSAndre Fischer maFIndent1.SetBackground(Wallpaper()); 52637fee4fdSAndre Fischer maFIndent2.SetBackground(Wallpaper()); 52737fee4fdSAndre Fischer maFIndent3.SetBackground(Wallpaper()); 52837fee4fdSAndre Fischer 52937fee4fdSAndre Fischer maFISpace1.SetImage(maSpace1); 530766ce4d0SZheng Fan maFISpace2.SetImage(maSpace2); 531766ce4d0SZheng Fan maFIndent1.SetImage(maIndent3); 532766ce4d0SZheng Fan maFIndent2.SetImage(maIndent2); 533766ce4d0SZheng Fan maFIndent3.SetImage(maIndent1); 534766ce4d0SZheng Fan 535766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_LEFT,sal_True,sal_False); 536766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_CENTER,sal_True,sal_False); 537766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_RIGHT,sal_True,sal_False); 538766ce4d0SZheng Fan GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_BLOCK,sal_True,sal_False); 539766ce4d0SZheng Fan 540766ce4d0SZheng Fan //toolbox 541766ce4d0SZheng Fan InitToolBoxAlign(); 542766ce4d0SZheng Fan InitToolBoxVertAlign(); 543766ce4d0SZheng Fan InitToolBoxIndent(); 544766ce4d0SZheng Fan InitToolBoxBGColor(); 545766ce4d0SZheng Fan InitToolBoxBulletsNumbering(); 546766ce4d0SZheng Fan InitToolBoxSpacing(); 547766ce4d0SZheng Fan InitToolBoxLineSpacing(); 548766ce4d0SZheng Fan 549766ce4d0SZheng Fan #ifdef HAS_IA2 550*b6ab65a3SAndre Fischer mpAlignToolBox->SetAccRelationLabeledBy(&mpAlignToolBox); 551*b6ab65a3SAndre Fischer mpTBxVertAlign->SetMpSubEditAccLableBy(&mpTBxVertAlign); 552*b6ab65a3SAndre Fischer mpTBxNumBullet->SetAccRelationLabeledBy(&mpTBxNumBullet); 553*b6ab65a3SAndre Fischer mpTBxBackColor->SetMpSubEditAccLableBy(&mpTBxBackColor); 554*b6ab65a3SAndre Fischer mpFTUL->SetAccRelationLabeledBy(&mpFTUL); 555*b6ab65a3SAndre Fischer mpTbxUL_IncDec->SetAccRelationLabeledBy(&mpTbxUL_IncDec); 556*b6ab65a3SAndre Fischer mpTopDist->SetAccRelationLabeledBy(&mpTopDist); 557*b6ab65a3SAndre Fischer mpBottomDist->SetAccRelationLabeledBy(&mpBottomDist); 558*b6ab65a3SAndre Fischer mpLineSPTbx->SetAccRelationLabeledBy(&mpLineSPTbx); 559*b6ab65a3SAndre Fischer mpFTIndent->SetAccRelationLabeledBy(&mpFTIndent); 560*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->SetAccRelationLabeledBy(&mpTbxIndent_IncDec); 561*b6ab65a3SAndre Fischer mpTbxProDemote->SetAccRelationLabeledBy(&mpTbxProDemote); 562*b6ab65a3SAndre Fischer mpLeftIndent->SetAccRelationLabeledBy(&mpLeftIndent); 563*b6ab65a3SAndre Fischer mpRightIndent->SetAccRelationLabeledBy(&mpRightIndent); 564*b6ab65a3SAndre Fischer mpFLineIndent->SetAccRelationLabeledBy(&mpFLineIndent); 565766ce4d0SZheng Fan mpColorUpdater->SetAccRelationLabeledBy(&mpColorUpdater); 566766ce4d0SZheng Fan #endif 567766ce4d0SZheng Fan } 568766ce4d0SZheng Fan 569766ce4d0SZheng Fan void ParaPropertyPanel::InitImageList(::boost::scoped_ptr<ToolBox>& rTbx, ImageList& rImglst, ImageList& rImgHlst) 570766ce4d0SZheng Fan { 571766ce4d0SZheng Fan sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark(); 572766ce4d0SZheng Fan 573766ce4d0SZheng Fan ImageList& rImgLst = bHighContrast ? rImgHlst : rImglst; 574766ce4d0SZheng Fan 575766ce4d0SZheng Fan sal_uInt16 nCount = rTbx->GetItemCount(); 576766ce4d0SZheng Fan for (sal_uInt16 i = 0; i < nCount; i++) 577766ce4d0SZheng Fan { 578766ce4d0SZheng Fan sal_uInt16 nId = rTbx->GetItemId(i); 579766ce4d0SZheng Fan rTbx->SetItemImage( nId, rImgLst.GetImage( nId ) ); 580766ce4d0SZheng Fan } 581766ce4d0SZheng Fan } 582766ce4d0SZheng Fan 583766ce4d0SZheng Fan //===========================for Numbering & Bullet================================================ 584766ce4d0SZheng Fan 585766ce4d0SZheng Fan 586766ce4d0SZheng Fan 587766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, NumBTbxDDHandler, ToolBox*, pToolBox) 588766ce4d0SZheng Fan { 589766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 590766ce4d0SZheng Fan 591766ce4d0SZheng Fan EndTracking(); 592766ce4d0SZheng Fan pToolBox->SetItemDown( nId, sal_True ); 593766ce4d0SZheng Fan 594766ce4d0SZheng Fan if (nId == 1) 595766ce4d0SZheng Fan { 596766ce4d0SZheng Fan maBulletsPopup.UpdateValueSet(); 597766ce4d0SZheng Fan maBulletsPopup.Show(*pToolBox); 598766ce4d0SZheng Fan } 599766ce4d0SZheng Fan else if (nId == 2) 600766ce4d0SZheng Fan { 601766ce4d0SZheng Fan maNumberingPopup.UpdateValueSet(); 602766ce4d0SZheng Fan maNumberingPopup.Show(*pToolBox); 603766ce4d0SZheng Fan } 604766ce4d0SZheng Fan pToolBox->SetItemDown( nId, sal_False ); 605766ce4d0SZheng Fan return 0; 606766ce4d0SZheng Fan } 607766ce4d0SZheng Fan 608766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, NumBTbxSelectHandler, ToolBox*, pToolBox) 609766ce4d0SZheng Fan { 610766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 611766ce4d0SZheng Fan sal_uInt16 nSID = SID_TABLE_VERT_NONE; 612766ce4d0SZheng Fan 613766ce4d0SZheng Fan EndTracking(); 614766ce4d0SZheng Fan if (nId == 1) 615766ce4d0SZheng Fan { 616766ce4d0SZheng Fan nSID = FN_NUM_BULLET_ON; 617766ce4d0SZheng Fan } 618766ce4d0SZheng Fan else if ( nId == 2) 619766ce4d0SZheng Fan { 620766ce4d0SZheng Fan nSID = FN_NUM_NUMBERING_ON; 621766ce4d0SZheng Fan } 622766ce4d0SZheng Fan SfxBoolItem aBoolItem(nSID, sal_True); 623766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 624766ce4d0SZheng Fan 625766ce4d0SZheng Fan return 0; 626766ce4d0SZheng Fan } 627766ce4d0SZheng Fan 628766ce4d0SZheng Fan 629766ce4d0SZheng Fan //================================for Vertical Alignment======================================== 630766ce4d0SZheng Fan 631766ce4d0SZheng Fan 632766ce4d0SZheng Fan 633766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, VertTbxSelectHandler, ToolBox*, pToolBox) 634766ce4d0SZheng Fan { 635766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 636766ce4d0SZheng Fan sal_uInt16 nSID = SID_TABLE_VERT_NONE; 637766ce4d0SZheng Fan EndTracking(); 638766ce4d0SZheng Fan if (nId == 1) 639766ce4d0SZheng Fan { 640766ce4d0SZheng Fan nSID = SID_TABLE_VERT_NONE; 641*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); 642*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 643*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 644766ce4d0SZheng Fan } 645766ce4d0SZheng Fan else if (nId == 2) 646766ce4d0SZheng Fan { 647766ce4d0SZheng Fan nSID = SID_TABLE_VERT_CENTER; 648*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 649*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); 650*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 651766ce4d0SZheng Fan } 652766ce4d0SZheng Fan else if (nId == 3) 653766ce4d0SZheng Fan { 654766ce4d0SZheng Fan nSID = SID_TABLE_VERT_BOTTOM; 655*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 656*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 657*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); 658766ce4d0SZheng Fan } 659766ce4d0SZheng Fan SfxBoolItem aBoolItem(nSID, sal_True); 660766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 661766ce4d0SZheng Fan 662766ce4d0SZheng Fan return 0; 663766ce4d0SZheng Fan } 664766ce4d0SZheng Fan 665766ce4d0SZheng Fan void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) 666766ce4d0SZheng Fan { 667766ce4d0SZheng Fan if (eState < SFX_ITEM_DONTCARE) 668766ce4d0SZheng Fan { 669*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 670*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 671*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 672*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_TOP, sal_False); 673*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_False); 674*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_False); 675766ce4d0SZheng Fan } 676766ce4d0SZheng Fan else 677766ce4d0SZheng Fan { 678*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_TOP, sal_True); 679*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_True); 680*b6ab65a3SAndre Fischer mpTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_True); 681766ce4d0SZheng Fan if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem))) 682766ce4d0SZheng Fan { 683766ce4d0SZheng Fan const SfxBoolItem* pItem= (const SfxBoolItem*)pState; 684766ce4d0SZheng Fan sal_Bool aBool = (sal_Bool)pItem->GetValue(); 685766ce4d0SZheng Fan 686766ce4d0SZheng Fan if (aBool) 687766ce4d0SZheng Fan { 688766ce4d0SZheng Fan if (nSID == SID_TABLE_VERT_NONE) 689766ce4d0SZheng Fan { 690*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); 691*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 692*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 693766ce4d0SZheng Fan } 694766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_CENTER) 695766ce4d0SZheng Fan { 696*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 697*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); 698*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 699766ce4d0SZheng Fan } 700766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_BOTTOM) 701766ce4d0SZheng Fan { 702*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 703*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 704*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); 705766ce4d0SZheng Fan } 706766ce4d0SZheng Fan } 707766ce4d0SZheng Fan else 708766ce4d0SZheng Fan { 709766ce4d0SZheng Fan if (nSID == SID_TABLE_VERT_NONE) 710766ce4d0SZheng Fan { 711*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 712766ce4d0SZheng Fan } 713766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_CENTER) 714766ce4d0SZheng Fan { 715*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 716766ce4d0SZheng Fan } 717766ce4d0SZheng Fan else if (nSID == SID_TABLE_VERT_BOTTOM) 718766ce4d0SZheng Fan { 719*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 720766ce4d0SZheng Fan } 721766ce4d0SZheng Fan } 722766ce4d0SZheng Fan } 723766ce4d0SZheng Fan else 724766ce4d0SZheng Fan { 725*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); 726*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); 727*b6ab65a3SAndre Fischer mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); 728766ce4d0SZheng Fan } 729766ce4d0SZheng Fan } 730766ce4d0SZheng Fan } 731766ce4d0SZheng Fan //==================================for Background color===================== 732766ce4d0SZheng Fan 733766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ToolBoxBackColorDDHandler,ToolBox*, pToolBox) 734766ce4d0SZheng Fan { 735766ce4d0SZheng Fan sal_uInt16 nId = pToolBox->GetCurItemId(); 736766ce4d0SZheng Fan OSL_ASSERT(nId == TBI_BACK_COLOR); 737766ce4d0SZheng Fan if(nId == TBI_BACK_COLOR) 738766ce4d0SZheng Fan { 739766ce4d0SZheng Fan pToolBox->SetItemDown( nId, true ); 740766ce4d0SZheng Fan maBGColorPopup.Show(*pToolBox); 741766ce4d0SZheng Fan maBGColorPopup.SetCurrentColor(maColor, mbColorAvailable); 742766ce4d0SZheng Fan } 743766ce4d0SZheng Fan return 0; 744766ce4d0SZheng Fan } 745766ce4d0SZheng Fan 746766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG ) 747766ce4d0SZheng Fan { 748766ce4d0SZheng Fan return 0; 749766ce4d0SZheng Fan } 750766ce4d0SZheng Fan 751766ce4d0SZheng Fan void ParaPropertyPanel::ShowMenu (void) 752766ce4d0SZheng Fan { 753766ce4d0SZheng Fan if (mpBindings != NULL) 754766ce4d0SZheng Fan { 755766ce4d0SZheng Fan SfxDispatcher* pDispatcher = mpBindings->GetDispatcher(); 756766ce4d0SZheng Fan if (pDispatcher != NULL) 757766ce4d0SZheng Fan pDispatcher->Execute(SID_PARA_DLG, SFX_CALLMODE_ASYNCHRON); 758766ce4d0SZheng Fan } 759766ce4d0SZheng Fan } 760766ce4d0SZheng Fan 7611715803bSPavel Janík void ParaPropertyPanel::ParaBKGStateChanged(sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState) 762766ce4d0SZheng Fan { 763445e496eSZheng Fan if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem)) 764766ce4d0SZheng Fan { 765445e496eSZheng Fan const SvxColorItem* pItem = (const SvxColorItem*)pState; 766445e496eSZheng Fan maColor = pItem->GetValue(); 767766ce4d0SZheng Fan mbColorAvailable = sal_True; 768766ce4d0SZheng Fan mpColorUpdater->Update(maColor); 769766ce4d0SZheng Fan } 770766ce4d0SZheng Fan else 771766ce4d0SZheng Fan { 772766ce4d0SZheng Fan mbColorAvailable = sal_False; 773766ce4d0SZheng Fan maColor.SetColor(COL_AUTO); 774766ce4d0SZheng Fan mpColorUpdater->Update(maColor); 775766ce4d0SZheng Fan } 776766ce4d0SZheng Fan } 777766ce4d0SZheng Fan 778766ce4d0SZheng Fan void ParaPropertyPanel::SetBGColor ( 7791715803bSPavel Janík const String& /* rsColorName */, 780766ce4d0SZheng Fan const Color aColor) 781766ce4d0SZheng Fan { 782766ce4d0SZheng Fan SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR); 783766ce4d0SZheng Fan mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L); 784766ce4d0SZheng Fan maColor = aColor; 785766ce4d0SZheng Fan } 786766ce4d0SZheng Fan 787766ce4d0SZheng Fan //==================================for Paragraph Alignment===================== 788766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, AlignStyleModifyHdl_Impl, ToolBox*, pBox ) 789766ce4d0SZheng Fan { 790766ce4d0SZheng Fan switch (pBox->GetCurItemId()) 791766ce4d0SZheng Fan { 792766ce4d0SZheng Fan case BT_SUBSTLEFT: 793766ce4d0SZheng Fan { 794766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); 795766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 796766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 797766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 798766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ); 799766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_LEFT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 800766ce4d0SZheng Fan } 801766ce4d0SZheng Fan break; 802766ce4d0SZheng Fan case BT_SUBSTCENTER: 803766ce4d0SZheng Fan { 804766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); 805766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 806766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 807766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 808766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ); 809766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_CENTER, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 810766ce4d0SZheng Fan } 811766ce4d0SZheng Fan break; 812766ce4d0SZheng Fan case BT_SUBSTRIGHT: 813766ce4d0SZheng Fan { 814766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); 815766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 816766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 817766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 818766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ); 819766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_RIGHT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 820766ce4d0SZheng Fan } 821766ce4d0SZheng Fan break; 822766ce4d0SZheng Fan case BT_SUBSTJUSTIFY: 823766ce4d0SZheng Fan { 824766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); 825766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 826766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 827766ce4d0SZheng Fan pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 828766ce4d0SZheng Fan SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ); 829766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_BLOCK, SFX_CALLMODE_RECORD, &aBoolItem, 0L); 830766ce4d0SZheng Fan } 831766ce4d0SZheng Fan break; 832766ce4d0SZheng Fan } 833766ce4d0SZheng Fan 834766ce4d0SZheng Fan return 0; 835766ce4d0SZheng Fan } 836766ce4d0SZheng Fan //==================================for Paragraph Indent===================== 8371715803bSPavel Janík IMPL_LINK( ParaPropertyPanel, ModifyIndentHdl_Impl, SvxRelativeField*, /* pBox */ ) 838766ce4d0SZheng Fan { 839512ec161SZheng Fan SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 840*b6ab65a3SAndre Fischer aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) ); 841*b6ab65a3SAndre Fischer aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); 842*b6ab65a3SAndre Fischer aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); 843766ce4d0SZheng Fan 844766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 845512ec161SZheng Fan SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 846766ce4d0SZheng Fan return 0; 847766ce4d0SZheng Fan } 848766ce4d0SZheng Fan 849766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl) 850766ce4d0SZheng Fan { 8518eda4adfSOliver-Rainer Wittmann switch (pControl->GetCurItemId()) 8528eda4adfSOliver-Rainer Wittmann { 8538eda4adfSOliver-Rainer Wittmann case INDENT_INCREMENT: 8548eda4adfSOliver-Rainer Wittmann { 8558eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 8568eda4adfSOliver-Rainer Wittmann { 8578eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 8588eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 8598eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 8608eda4adfSOliver-Rainer Wittmann { 8618eda4adfSOliver-Rainer Wittmann SfxBoolItem aMargin( SID_INC_INDENT, sal_True ); 8628eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8638eda4adfSOliver-Rainer Wittmann SID_INC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L); 8648eda4adfSOliver-Rainer Wittmann } 8658eda4adfSOliver-Rainer Wittmann break; 8668eda4adfSOliver-Rainer Wittmann default: 8678eda4adfSOliver-Rainer Wittmann { 8688eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 8698eda4adfSOliver-Rainer Wittmann 8708eda4adfSOliver-Rainer Wittmann maTxtLeft += INDENT_STEP; 8718eda4adfSOliver-Rainer Wittmann sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 8728eda4adfSOliver-Rainer Wittmann nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 8738eda4adfSOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)nVal ); 874*b6ab65a3SAndre Fischer aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); 875*b6ab65a3SAndre Fischer aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); 8768eda4adfSOliver-Rainer Wittmann 8778eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8788eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 8798eda4adfSOliver-Rainer Wittmann } 8808eda4adfSOliver-Rainer Wittmann } 8818eda4adfSOliver-Rainer Wittmann } 8828eda4adfSOliver-Rainer Wittmann break; 8838eda4adfSOliver-Rainer Wittmann case INDENT_DECREMENT: 8848eda4adfSOliver-Rainer Wittmann { 8858eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 8868eda4adfSOliver-Rainer Wittmann { 8878eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 8888eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 8898eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 8908eda4adfSOliver-Rainer Wittmann { 8918eda4adfSOliver-Rainer Wittmann SfxBoolItem aMargin( SID_DEC_INDENT, sal_True ); 8928eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 8938eda4adfSOliver-Rainer Wittmann SID_DEC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L); 8948eda4adfSOliver-Rainer Wittmann } 8958eda4adfSOliver-Rainer Wittmann break; 8968eda4adfSOliver-Rainer Wittmann default: 8978eda4adfSOliver-Rainer Wittmann { 8988eda4adfSOliver-Rainer Wittmann if((maTxtLeft - INDENT_STEP) < 0) 8998eda4adfSOliver-Rainer Wittmann maTxtLeft = DEFAULT_VALUE; 9008eda4adfSOliver-Rainer Wittmann else 9018eda4adfSOliver-Rainer Wittmann maTxtLeft -= INDENT_STEP; 9028eda4adfSOliver-Rainer Wittmann 9038eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 9048eda4adfSOliver-Rainer Wittmann 9058eda4adfSOliver-Rainer Wittmann sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 9068eda4adfSOliver-Rainer Wittmann nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 9078eda4adfSOliver-Rainer Wittmann 9088eda4adfSOliver-Rainer Wittmann aMargin.SetTxtLeft( (const long)nVal ); 909*b6ab65a3SAndre Fischer aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); 910*b6ab65a3SAndre Fischer aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); 9118eda4adfSOliver-Rainer Wittmann 9128eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 9138eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 9148eda4adfSOliver-Rainer Wittmann } 9158eda4adfSOliver-Rainer Wittmann } 9168eda4adfSOliver-Rainer Wittmann } 9178eda4adfSOliver-Rainer Wittmann break; 9188eda4adfSOliver-Rainer Wittmann case ID_HANGING_INDENT: 9198eda4adfSOliver-Rainer Wittmann { 9208eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 921*b6ab65a3SAndre Fischer aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); 922*b6ab65a3SAndre Fischer aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); 923*b6ab65a3SAndre Fischer aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); 924766ce4d0SZheng Fan 9258eda4adfSOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( 9268eda4adfSOliver-Rainer Wittmann SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 9278eda4adfSOliver-Rainer Wittmann } 9288eda4adfSOliver-Rainer Wittmann break; 9298eda4adfSOliver-Rainer Wittmann } 9308eda4adfSOliver-Rainer Wittmann return( 0L ); 931766ce4d0SZheng Fan } 932766ce4d0SZheng Fan 933766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl) 934766ce4d0SZheng Fan { 935395b75f9SOliver-Rainer Wittmann switch (pControl->GetCurItemId()) 936395b75f9SOliver-Rainer Wittmann { 937395b75f9SOliver-Rainer Wittmann case BT_TBX_INDENT_PROMOTE: 938395b75f9SOliver-Rainer Wittmann { 939395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_OUTLINE_RIGHT, SFX_CALLMODE_RECORD ); 940395b75f9SOliver-Rainer Wittmann } 941395b75f9SOliver-Rainer Wittmann break; 942395b75f9SOliver-Rainer Wittmann case BT_TBX_INDENT_DEMOTE: 943395b75f9SOliver-Rainer Wittmann { 944395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_OUTLINE_LEFT, SFX_CALLMODE_RECORD ); 945395b75f9SOliver-Rainer Wittmann } 946395b75f9SOliver-Rainer Wittmann break; 947395b75f9SOliver-Rainer Wittmann case SD_HANGING_INDENT: 948395b75f9SOliver-Rainer Wittmann { 949395b75f9SOliver-Rainer Wittmann SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); 950*b6ab65a3SAndre Fischer aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); 951*b6ab65a3SAndre Fischer aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); 952*b6ab65a3SAndre Fischer aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); 953395b75f9SOliver-Rainer Wittmann 954395b75f9SOliver-Rainer Wittmann GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 955395b75f9SOliver-Rainer Wittmann } 956395b75f9SOliver-Rainer Wittmann break; 957395b75f9SOliver-Rainer Wittmann } 958395b75f9SOliver-Rainer Wittmann return( 0L ); 959766ce4d0SZheng Fan } 960766ce4d0SZheng Fan //==================================for Paragraph Line Spacing===================== 961766ce4d0SZheng Fan 962766ce4d0SZheng Fan IMPL_LINK( ParaPropertyPanel, ClickLineSPDropDownHdl_Impl, ToolBox*, pBox ) 963766ce4d0SZheng Fan { 964766ce4d0SZheng Fan 965766ce4d0SZheng Fan const sal_uInt16 nId = pBox->GetCurItemId(); 966766ce4d0SZheng Fan OSL_ASSERT(nId == TOOLBOX_ITEM1); 967766ce4d0SZheng Fan if(nId == TOOLBOX_ITEM1) 968766ce4d0SZheng Fan { 969766ce4d0SZheng Fan pBox->SetItemDown( nId, true ); 970766ce4d0SZheng Fan maLineSpacePopup.Rearrange(meLnSpState,m_eMetricUnit,mpLnSPItem,maContext); 971766ce4d0SZheng Fan maLineSpacePopup.Show(*pBox); 972766ce4d0SZheng Fan 973766ce4d0SZheng Fan } 974766ce4d0SZheng Fan return (0L); 975766ce4d0SZheng Fan } 976766ce4d0SZheng Fan 977766ce4d0SZheng Fan //==================================for Paragraph Spacing===================== 9781715803bSPavel Janík IMPL_LINK( ParaPropertyPanel, ULSpaceHdl_Impl, SvxRelativeField*, /* pBox */) 979766ce4d0SZheng Fan { 980512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 981*b6ab65a3SAndre Fischer aMargin.SetUpper( (sal_uInt16)GetCoreValue( *mpTopDist, m_eULSpaceUnit ) ); 982*b6ab65a3SAndre Fischer aMargin.SetLower( (sal_uInt16)GetCoreValue( *mpBottomDist, m_eULSpaceUnit ) ); 983766ce4d0SZheng Fan 984766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 985512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 986766ce4d0SZheng Fan return 0L; 987766ce4d0SZheng Fan } 988766ce4d0SZheng Fan 989766ce4d0SZheng Fan IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) 990766ce4d0SZheng Fan { 991766ce4d0SZheng Fan switch (pControl->GetCurItemId()) 992766ce4d0SZheng Fan { 993e1bac94cSAndre Fischer case BT_TBX_UL_INC: 994766ce4d0SZheng Fan { 995512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 996766ce4d0SZheng Fan 997766ce4d0SZheng Fan maUpper += UL_STEP; 998766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 999766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1000766ce4d0SZheng Fan aMargin.SetUpper( (const sal_uInt16)nVal ); 1001766ce4d0SZheng Fan 1002766ce4d0SZheng Fan maLower += UL_STEP; 1003766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1004766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1005766ce4d0SZheng Fan aMargin.SetLower( (const sal_uInt16)nVal ); 1006766ce4d0SZheng Fan 1007766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 1008512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 1009766ce4d0SZheng Fan } 1010766ce4d0SZheng Fan break; 1011e1bac94cSAndre Fischer case BT_TBX_UL_DEC: 1012766ce4d0SZheng Fan { 1013512ec161SZheng Fan SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); 1014766ce4d0SZheng Fan 1015766ce4d0SZheng Fan if( maUpper >= UL_STEP ) 1016766ce4d0SZheng Fan { 1017766ce4d0SZheng Fan maUpper -= UL_STEP; 1018766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1019766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1020766ce4d0SZheng Fan aMargin.SetUpper( (const sal_uInt16)nVal ); 1021766ce4d0SZheng Fan } 1022766ce4d0SZheng Fan else 1023766ce4d0SZheng Fan aMargin.SetUpper( DEFAULT_VALUE ); 1024766ce4d0SZheng Fan if( maLower >= UL_STEP ) 1025766ce4d0SZheng Fan { 1026766ce4d0SZheng Fan maLower -= UL_STEP; 1027766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1028766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); 1029766ce4d0SZheng Fan aMargin.SetLower( (const sal_uInt16)nVal ); 1030766ce4d0SZheng Fan } 1031766ce4d0SZheng Fan else 1032766ce4d0SZheng Fan aMargin.SetLower( DEFAULT_VALUE ); 1033766ce4d0SZheng Fan 1034766ce4d0SZheng Fan GetBindings()->GetDispatcher()->Execute( 1035512ec161SZheng Fan SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); 1036766ce4d0SZheng Fan } 1037766ce4d0SZheng Fan break; 1038766ce4d0SZheng Fan } 1039766ce4d0SZheng Fan return( 0L ); 1040766ce4d0SZheng Fan } 1041766ce4d0SZheng Fan 1042766ce4d0SZheng Fan //==================================for Paragraph State change===================== 104345da7d5eSAndre Fischer void ParaPropertyPanel::NotifyItemUpdate( 104445da7d5eSAndre Fischer sal_uInt16 nSID, 104545da7d5eSAndre Fischer SfxItemState eState, 104645da7d5eSAndre Fischer const SfxPoolItem* pState, 104745da7d5eSAndre Fischer const bool bIsEnabled) 104845da7d5eSAndre Fischer { 104945da7d5eSAndre Fischer (void)bIsEnabled; 1050766ce4d0SZheng Fan 1051af89ca6eSOliver-Rainer Wittmann switch (nSID) 1052af89ca6eSOliver-Rainer Wittmann { 1053af89ca6eSOliver-Rainer Wittmann case SID_ATTR_METRIC: 1054af89ca6eSOliver-Rainer Wittmann { 1055af89ca6eSOliver-Rainer Wittmann m_eMetricUnit = GetCurrentUnit(eState,pState); 1056af89ca6eSOliver-Rainer Wittmann if( m_eMetricUnit!=m_last_eMetricUnit ) 1057af89ca6eSOliver-Rainer Wittmann { 1058*b6ab65a3SAndre Fischer SetFieldUnit( *mpLeftIndent, m_eMetricUnit ); 1059*b6ab65a3SAndre Fischer SetFieldUnit( *mpRightIndent, m_eMetricUnit ); 1060*b6ab65a3SAndre Fischer SetFieldUnit( *mpFLineIndent, m_eMetricUnit ); 1061*b6ab65a3SAndre Fischer SetFieldUnit( *mpTopDist, m_eMetricUnit ); 1062*b6ab65a3SAndre Fischer SetFieldUnit( *mpBottomDist, m_eMetricUnit ); 1063af89ca6eSOliver-Rainer Wittmann } 1064af89ca6eSOliver-Rainer Wittmann m_last_eMetricUnit = m_eMetricUnit; 1065af89ca6eSOliver-Rainer Wittmann } 1066af89ca6eSOliver-Rainer Wittmann break; 1067766ce4d0SZheng Fan 1068af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_LRSPACE: 1069af89ca6eSOliver-Rainer Wittmann StateChangedIndentImpl( nSID, eState, pState ); 1070af89ca6eSOliver-Rainer Wittmann break; 1071766ce4d0SZheng Fan 1072af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_LINESPACE: 1073af89ca6eSOliver-Rainer Wittmann StateChangedLnSPImpl( nSID, eState, pState ); 1074af89ca6eSOliver-Rainer Wittmann break; 1075766ce4d0SZheng Fan 1076af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ULSPACE: 1077af89ca6eSOliver-Rainer Wittmann StateChangedULImpl( nSID, eState, pState ); 1078af89ca6eSOliver-Rainer Wittmann break; 1079766ce4d0SZheng Fan 1080af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_LEFT: 1081af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_CENTER: 1082af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_RIGHT: 1083af89ca6eSOliver-Rainer Wittmann case SID_ATTR_PARA_ADJUST_BLOCK: 1084af89ca6eSOliver-Rainer Wittmann StateChangedAlignmentImpl( nSID, eState, pState ); 1085af89ca6eSOliver-Rainer Wittmann break; 1086766ce4d0SZheng Fan 1087af89ca6eSOliver-Rainer Wittmann case SID_OUTLINE_LEFT: 1088af89ca6eSOliver-Rainer Wittmann case SID_OUTLINE_RIGHT: 1089af89ca6eSOliver-Rainer Wittmann StateChangeOutLineImpl( nSID, eState, pState ); 1090af89ca6eSOliver-Rainer Wittmann break; 1091766ce4d0SZheng Fan 1092af89ca6eSOliver-Rainer Wittmann case SID_INC_INDENT: 1093af89ca6eSOliver-Rainer Wittmann case SID_DEC_INDENT: 1094af89ca6eSOliver-Rainer Wittmann StateChangeIncDecImpl( nSID, eState, pState ); 1095af89ca6eSOliver-Rainer Wittmann break; 1096af89ca6eSOliver-Rainer Wittmann 1097af89ca6eSOliver-Rainer Wittmann case FN_NUM_NUMBERING_ON: 1098af89ca6eSOliver-Rainer Wittmann case FN_NUM_BULLET_ON: 1099af89ca6eSOliver-Rainer Wittmann StateChangeBulletNumImpl( nSID, eState, pState ); 1100af89ca6eSOliver-Rainer Wittmann break; 1101af89ca6eSOliver-Rainer Wittmann 1102af89ca6eSOliver-Rainer Wittmann case FN_BUL_NUM_RULE_INDEX: 1103af89ca6eSOliver-Rainer Wittmann case FN_NUM_NUM_RULE_INDEX: 1104af89ca6eSOliver-Rainer Wittmann StateChangeBulletNumRuleImpl( nSID, eState, pState ); 1105af89ca6eSOliver-Rainer Wittmann break; 1106af89ca6eSOliver-Rainer Wittmann 1107af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_NONE: 1108af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_CENTER: 1109af89ca6eSOliver-Rainer Wittmann case SID_TABLE_VERT_BOTTOM: 1110af89ca6eSOliver-Rainer Wittmann VertStateChanged( nSID, eState, pState); 1111af89ca6eSOliver-Rainer Wittmann break; 1112af89ca6eSOliver-Rainer Wittmann 1113af89ca6eSOliver-Rainer Wittmann case SID_BACKGROUND_COLOR: 1114af89ca6eSOliver-Rainer Wittmann ParaBKGStateChanged(nSID, eState, pState); 1115af89ca6eSOliver-Rainer Wittmann break; 1116af89ca6eSOliver-Rainer Wittmann } 1117766ce4d0SZheng Fan } 1118766ce4d0SZheng Fan 111945da7d5eSAndre Fischer 112045da7d5eSAndre Fischer 112145da7d5eSAndre Fischer 1122766ce4d0SZheng Fan void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1123766ce4d0SZheng Fan { 1124766ce4d0SZheng Fan if( eState >= SFX_ITEM_AVAILABLE ) 1125766ce4d0SZheng Fan { 1126766ce4d0SZheng Fan const SfxBoolItem* pItem = (const SfxBoolItem*)pState; 1127766ce4d0SZheng Fan bool IsChecked = (bool)pItem->GetValue(); 1128766ce4d0SZheng Fan switch (nSID) 1129766ce4d0SZheng Fan { 1130766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT: 1131766ce4d0SZheng Fan { 1132766ce4d0SZheng Fan if(IsChecked) 1133766ce4d0SZheng Fan { 1134*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); 1135*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1136*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1137*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1138766ce4d0SZheng Fan } 1139766ce4d0SZheng Fan else 1140*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1141766ce4d0SZheng Fan } 1142766ce4d0SZheng Fan break; 1143766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER: 1144766ce4d0SZheng Fan { 1145766ce4d0SZheng Fan if(IsChecked) 1146766ce4d0SZheng Fan { 1147*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); 1148*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1149*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1150*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1151766ce4d0SZheng Fan } 1152766ce4d0SZheng Fan else 1153*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1154766ce4d0SZheng Fan } 1155766ce4d0SZheng Fan break; 1156766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT: 1157766ce4d0SZheng Fan { 1158766ce4d0SZheng Fan if(IsChecked) 1159766ce4d0SZheng Fan { 1160*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); 1161*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1162*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1163*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1164766ce4d0SZheng Fan } 1165766ce4d0SZheng Fan else 1166*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1167766ce4d0SZheng Fan } 1168766ce4d0SZheng Fan break; 1169766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK: 1170766ce4d0SZheng Fan { 1171766ce4d0SZheng Fan if(IsChecked) 1172766ce4d0SZheng Fan { 1173*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); 1174*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1175*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1176*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1177766ce4d0SZheng Fan } 1178766ce4d0SZheng Fan else 1179*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1180766ce4d0SZheng Fan } 1181766ce4d0SZheng Fan break; 1182766ce4d0SZheng Fan } 1183766ce4d0SZheng Fan } 1184766ce4d0SZheng Fan else if( eState == SFX_ITEM_DISABLED ) 1185766ce4d0SZheng Fan { 1186766ce4d0SZheng Fan } 1187766ce4d0SZheng Fan else if ( eState == SFX_ITEM_DONTCARE ) 1188766ce4d0SZheng Fan { 1189766ce4d0SZheng Fan switch (nSID) 1190766ce4d0SZheng Fan { 1191766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_LEFT: 1192*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); 1193766ce4d0SZheng Fan break; 1194766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_CENTER: 1195*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); 1196766ce4d0SZheng Fan break; 1197766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_RIGHT: 1198*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); 1199766ce4d0SZheng Fan break; 1200766ce4d0SZheng Fan case SID_ATTR_PARA_ADJUST_BLOCK: 1201*b6ab65a3SAndre Fischer mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); 1202766ce4d0SZheng Fan break; 1203766ce4d0SZheng Fan } 1204766ce4d0SZheng Fan } 1205766ce4d0SZheng Fan } 1206766ce4d0SZheng Fan 12071715803bSPavel Janík void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1208766ce4d0SZheng Fan { 12098eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 12108eda4adfSOliver-Rainer Wittmann { 1211766ce4d0SZheng Fan 12128eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 12138eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 12148eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_Calc, Context_DrawText): 12158eda4adfSOliver-Rainer Wittmann { 1216*b6ab65a3SAndre Fischer mpLeftIndent->SetMin( DEFAULT_VALUE ); 1217*b6ab65a3SAndre Fischer mpRightIndent->SetMin( DEFAULT_VALUE ); 1218*b6ab65a3SAndre Fischer mpFLineIndent->SetMin( DEFAULT_VALUE ); 1219*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 1220*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 12218eda4adfSOliver-Rainer Wittmann } 12228eda4adfSOliver-Rainer Wittmann break; 12238eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 12248eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Draw): 12258eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 12268eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 12278eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Table): 12288eda4adfSOliver-Rainer Wittmann { 1229*b6ab65a3SAndre Fischer mpLeftIndent->SetMin( DEFAULT_VALUE ); 1230*b6ab65a3SAndre Fischer mpRightIndent->SetMin( DEFAULT_VALUE ); 1231*b6ab65a3SAndre Fischer mpFLineIndent->SetMin( DEFAULT_VALUE ); 1232*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Hide(); 1233*b6ab65a3SAndre Fischer mpTbxProDemote->Show(); 12348eda4adfSOliver-Rainer Wittmann } 12358eda4adfSOliver-Rainer Wittmann break; 12368eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 12378eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 12388eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 12398eda4adfSOliver-Rainer Wittmann { 1240*b6ab65a3SAndre Fischer mpLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 1241*b6ab65a3SAndre Fischer mpRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 1242*b6ab65a3SAndre Fischer mpFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM ); 1243*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Show(); 1244*b6ab65a3SAndre Fischer mpTbxProDemote->Hide(); 12458eda4adfSOliver-Rainer Wittmann } 12468eda4adfSOliver-Rainer Wittmann break; 12478eda4adfSOliver-Rainer Wittmann } 1248766ce4d0SZheng Fan 12498eda4adfSOliver-Rainer Wittmann if( pState && eState >= SFX_ITEM_AVAILABLE ) 12508eda4adfSOliver-Rainer Wittmann { 12518eda4adfSOliver-Rainer Wittmann SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState; 12528eda4adfSOliver-Rainer Wittmann maTxtLeft = pSpace->GetTxtLeft(); 12538eda4adfSOliver-Rainer Wittmann maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12548eda4adfSOliver-Rainer Wittmann maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12558eda4adfSOliver-Rainer Wittmann 12568eda4adfSOliver-Rainer Wittmann long aTxtRight = pSpace->GetRight(); 12578eda4adfSOliver-Rainer Wittmann aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12588eda4adfSOliver-Rainer Wittmann aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12598eda4adfSOliver-Rainer Wittmann 12608eda4adfSOliver-Rainer Wittmann long aTxtFirstLineOfst = pSpace->GetTxtFirstLineOfst(); 12618eda4adfSOliver-Rainer Wittmann aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM ); 12628eda4adfSOliver-Rainer Wittmann aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 12638eda4adfSOliver-Rainer Wittmann 12648eda4adfSOliver-Rainer Wittmann long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1265*b6ab65a3SAndre Fischer nVal = (long)mpLeftIndent->Normalize( (long)nVal ); 1266*b6ab65a3SAndre Fischer mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM ); 12678eda4adfSOliver-Rainer Wittmann 12688eda4adfSOliver-Rainer Wittmann if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) 12698eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) 12708eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table)) 12718eda4adfSOliver-Rainer Wittmann { 1272*b6ab65a3SAndre Fischer mpFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM ); 12738eda4adfSOliver-Rainer Wittmann } 1274766ce4d0SZheng Fan 12758eda4adfSOliver-Rainer Wittmann long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1276*b6ab65a3SAndre Fischer nrVal = (long)mpRightIndent->Normalize( (long)nrVal ); 1277*b6ab65a3SAndre Fischer mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM ); 1278766ce4d0SZheng Fan 12798eda4adfSOliver-Rainer Wittmann long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1280*b6ab65a3SAndre Fischer nfVal = (long)mpFLineIndent->Normalize( (long)nfVal ); 1281*b6ab65a3SAndre Fischer mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); 12828eda4adfSOliver-Rainer Wittmann 12838eda4adfSOliver-Rainer Wittmann switch (maContext.GetCombinedContext_DI()) 12848eda4adfSOliver-Rainer Wittmann { 12858eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_DrawText): 12868eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Text): 12878eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Default): 12888eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Table): 12898eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_WriterVariants, Context_Annotation): 12908eda4adfSOliver-Rainer Wittmann { 1291*b6ab65a3SAndre Fischer mpLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM ); 1292*b6ab65a3SAndre Fischer mpRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM ); 1293*b6ab65a3SAndre Fischer mpFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM ); 12948eda4adfSOliver-Rainer Wittmann } 12958eda4adfSOliver-Rainer Wittmann break; 12968eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_DrawText): 12978eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Draw): 12988eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Table): 12998eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_TextObject): 13008eda4adfSOliver-Rainer Wittmann case CombinedEnumContext(Application_DrawImpress, Context_Graphic): 13018eda4adfSOliver-Rainer Wittmann { 1302*b6ab65a3SAndre Fischer mpLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM ); 1303*b6ab65a3SAndre Fischer mpRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM ); 1304*b6ab65a3SAndre Fischer mpFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM ); 13058eda4adfSOliver-Rainer Wittmann } 13068eda4adfSOliver-Rainer Wittmann } 1307766ce4d0SZheng Fan 1308*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Enable(); 1309*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True); 13108eda4adfSOliver-Rainer Wittmann if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) 13118eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) 13128eda4adfSOliver-Rainer Wittmann && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1313eeb4e5d3SOliver-Rainer Wittmann { 1314*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True); 1315*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True); 1316eeb4e5d3SOliver-Rainer Wittmann } 1317766ce4d0SZheng Fan 1318*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True); 13198eda4adfSOliver-Rainer Wittmann } 13208eda4adfSOliver-Rainer Wittmann else if( eState == SFX_ITEM_DISABLED ) 13218eda4adfSOliver-Rainer Wittmann { 1322*b6ab65a3SAndre Fischer mpLeftIndent-> Disable(); 1323*b6ab65a3SAndre Fischer mpRightIndent->Disable(); 1324*b6ab65a3SAndre Fischer mpFLineIndent->Disable(); 1325*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Disable(); 13268eda4adfSOliver-Rainer Wittmann if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && 13278eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && 13288eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1329*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Disable(); 13308eda4adfSOliver-Rainer Wittmann else 1331*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); 13328eda4adfSOliver-Rainer Wittmann 13338eda4adfSOliver-Rainer Wittmann // maTbxProDemote->Disable(); 1334*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); 13358eda4adfSOliver-Rainer Wittmann } 13368eda4adfSOliver-Rainer Wittmann else 13378eda4adfSOliver-Rainer Wittmann { 1338*b6ab65a3SAndre Fischer mpLeftIndent->SetEmptyFieldValue(); 1339*b6ab65a3SAndre Fischer mpRightIndent->SetEmptyFieldValue(); 1340*b6ab65a3SAndre Fischer mpFLineIndent->SetEmptyFieldValue(); 13418eda4adfSOliver-Rainer Wittmann if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && 13428eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && 13438eda4adfSOliver-Rainer Wittmann maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1344*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->Disable(); 13458eda4adfSOliver-Rainer Wittmann else 1346*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); 1347*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); 13488eda4adfSOliver-Rainer Wittmann } 1349766ce4d0SZheng Fan } 1350766ce4d0SZheng Fan 13511715803bSPavel Janík void ParaPropertyPanel::StateChangedLnSPImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1352766ce4d0SZheng Fan { 1353766ce4d0SZheng Fan meLnSpState = eState; 1354766ce4d0SZheng Fan 1355766ce4d0SZheng Fan if( pState && eState >= SFX_ITEM_AVAILABLE ) 1356766ce4d0SZheng Fan { 1357766ce4d0SZheng Fan if(mpLnSPItem) 1358766ce4d0SZheng Fan delete mpLnSPItem; 1359766ce4d0SZheng Fan mpLnSPItem = ( SvxLineSpacingItem *)pState->Clone(); 1360766ce4d0SZheng Fan } 1361766ce4d0SZheng Fan } 1362766ce4d0SZheng Fan 13631715803bSPavel Janík void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState ) 1364766ce4d0SZheng Fan { 1365*b6ab65a3SAndre Fischer mpTopDist->SetMax( mpTopDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) ); 1366*b6ab65a3SAndre Fischer mpBottomDist->SetMax( mpBottomDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) ); 1367766ce4d0SZheng Fan 1368766ce4d0SZheng Fan if( pState && eState >= SFX_ITEM_AVAILABLE ) 1369766ce4d0SZheng Fan { 1370766ce4d0SZheng Fan SvxULSpaceItem* pOldItem = (SvxULSpaceItem*)pState; 1371766ce4d0SZheng Fan 1372766ce4d0SZheng Fan maUpper = pOldItem->GetUpper(); 1373766ce4d0SZheng Fan maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); 1374766ce4d0SZheng Fan maUpper = OutputDevice::LogicToLogic( maUpper, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 1375766ce4d0SZheng Fan 1376766ce4d0SZheng Fan maLower = pOldItem->GetLower(); 1377766ce4d0SZheng Fan maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM ); 1378766ce4d0SZheng Fan maLower = OutputDevice::LogicToLogic( maLower, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) ); 1379766ce4d0SZheng Fan 1380766ce4d0SZheng Fan sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1381*b6ab65a3SAndre Fischer nVal = mpTopDist->Normalize( nVal ); 1382*b6ab65a3SAndre Fischer mpTopDist->SetValue( nVal, FUNIT_100TH_MM ); 1383766ce4d0SZheng Fan 1384766ce4d0SZheng Fan nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); 1385*b6ab65a3SAndre Fischer nVal = mpBottomDist->Normalize( nVal ); 1386*b6ab65a3SAndre Fischer mpBottomDist->SetValue( nVal, FUNIT_100TH_MM ); 1387*b6ab65a3SAndre Fischer mpTbxUL_IncDec->Enable(); 1388766ce4d0SZheng Fan } 1389512ec161SZheng Fan else if(eState == SFX_ITEM_DISABLED ) 1390766ce4d0SZheng Fan { 1391*b6ab65a3SAndre Fischer mpTopDist->Disable(); 1392*b6ab65a3SAndre Fischer mpBottomDist->Disable(); 1393*b6ab65a3SAndre Fischer mpTbxUL_IncDec->Disable(); 1394766ce4d0SZheng Fan } 1395512ec161SZheng Fan else 1396766ce4d0SZheng Fan { 1397*b6ab65a3SAndre Fischer mpTopDist->SetEmptyFieldValue(); 1398*b6ab65a3SAndre Fischer mpBottomDist->SetEmptyFieldValue(); 1399*b6ab65a3SAndre Fischer mpTbxUL_IncDec->Disable(); 1400766ce4d0SZheng Fan } 1401766ce4d0SZheng Fan } 1402766ce4d0SZheng Fan 1403766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1404766ce4d0SZheng Fan { 1405766ce4d0SZheng Fan if (nSID==SID_OUTLINE_LEFT) 1406766ce4d0SZheng Fan { 1407766ce4d0SZheng Fan if( pState && eState == SFX_ITEM_UNKNOWN ) 1408766ce4d0SZheng Fan mbOutLineLeft = 1; 1409766ce4d0SZheng Fan else 1410766ce4d0SZheng Fan mbOutLineLeft = 0; 1411766ce4d0SZheng Fan } 1412766ce4d0SZheng Fan if (nSID==SID_OUTLINE_RIGHT) 1413766ce4d0SZheng Fan { 1414766ce4d0SZheng Fan if( pState && eState == SFX_ITEM_UNKNOWN ) 1415766ce4d0SZheng Fan mbOutLineRight = 1; 1416766ce4d0SZheng Fan else 1417766ce4d0SZheng Fan mbOutLineRight = 0; 1418766ce4d0SZheng Fan } 1419766ce4d0SZheng Fan if(mbOutLineLeft) 1420*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_True); 1421766ce4d0SZheng Fan else 1422*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_False); 1423766ce4d0SZheng Fan 1424766ce4d0SZheng Fan if(mbOutLineRight) 1425*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_True); 1426766ce4d0SZheng Fan else 1427*b6ab65a3SAndre Fischer mpTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_False); 1428766ce4d0SZheng Fan 1429766ce4d0SZheng Fan } 1430766ce4d0SZheng Fan 1431766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1432766ce4d0SZheng Fan { 14338eda4adfSOliver-Rainer Wittmann if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Text) 14348eda4adfSOliver-Rainer Wittmann || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Default) 14358eda4adfSOliver-Rainer Wittmann || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Table) ) 1436eeb4e5d3SOliver-Rainer Wittmann && ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) ) 1437eeb4e5d3SOliver-Rainer Wittmann { 1438eeb4e5d3SOliver-Rainer Wittmann // Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT 1439eeb4e5d3SOliver-Rainer Wittmann // - namely SFX_ITEM_UNKNOWN and SFX_ITEM_DISABLED 1440*b6ab65a3SAndre Fischer mpTbxIndent_IncDec->EnableItem( 1441eeb4e5d3SOliver-Rainer Wittmann nSID == SID_INC_INDENT ? BT_TBX_INDENT_INC : BT_TBX_INDENT_DEC, 1442eeb4e5d3SOliver-Rainer Wittmann ( pState && eState == SFX_ITEM_UNKNOWN ) ? sal_True : sal_False ); 1443eeb4e5d3SOliver-Rainer Wittmann } 1444766ce4d0SZheng Fan } 1445eeb4e5d3SOliver-Rainer Wittmann 1446eeb4e5d3SOliver-Rainer Wittmann 144737fee4fdSAndre Fischer // Add toggle state for numbering and bullet icons 1448766ce4d0SZheng Fan void ParaPropertyPanel::StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1449766ce4d0SZheng Fan { 14507aed46aaSOliver-Rainer Wittmann if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)) ) 14517aed46aaSOliver-Rainer Wittmann { 1452af89ca6eSOliver-Rainer Wittmann const SfxBoolItem* pItem= (const SfxBoolItem*)pState; 1453af89ca6eSOliver-Rainer Wittmann const sal_Bool aBool = (sal_Bool)pItem->GetValue(); 14547aed46aaSOliver-Rainer Wittmann if (nSID==FN_NUM_NUMBERING_ON) 14557aed46aaSOliver-Rainer Wittmann { 1456*b6ab65a3SAndre Fischer mpTBxNumBullet->SetItemState( 1457af89ca6eSOliver-Rainer Wittmann IID_NUMBER, 1458af89ca6eSOliver-Rainer Wittmann aBool ? STATE_CHECK : STATE_NOCHECK ); 14597aed46aaSOliver-Rainer Wittmann } 14607aed46aaSOliver-Rainer Wittmann else if (nSID==FN_NUM_BULLET_ON) 14617aed46aaSOliver-Rainer Wittmann { 1462*b6ab65a3SAndre Fischer mpTBxNumBullet->SetItemState( 1463af89ca6eSOliver-Rainer Wittmann IID_BULLET, 1464af89ca6eSOliver-Rainer Wittmann aBool ? STATE_CHECK : STATE_NOCHECK ); 14657aed46aaSOliver-Rainer Wittmann } 14667aed46aaSOliver-Rainer Wittmann } 1467766ce4d0SZheng Fan } 14687aed46aaSOliver-Rainer Wittmann 14697aed46aaSOliver-Rainer Wittmann 14707aed46aaSOliver-Rainer Wittmann void ParaPropertyPanel::StateChangeBulletNumRuleImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) 1471766ce4d0SZheng Fan { 14727aed46aaSOliver-Rainer Wittmann if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxUInt16Item) ) 14737aed46aaSOliver-Rainer Wittmann { 14747aed46aaSOliver-Rainer Wittmann sal_uInt16 nValue = (sal_uInt16)0xFFFF; 14757aed46aaSOliver-Rainer Wittmann { 14767aed46aaSOliver-Rainer Wittmann const SfxUInt16Item* pIt = (const SfxUInt16Item*)pState; 14777aed46aaSOliver-Rainer Wittmann if ( pIt ) 14787aed46aaSOliver-Rainer Wittmann nValue = pIt->GetValue(); 14797aed46aaSOliver-Rainer Wittmann } 1480766ce4d0SZheng Fan 14817aed46aaSOliver-Rainer Wittmann if ( nSID == FN_BUL_NUM_RULE_INDEX ) 14827aed46aaSOliver-Rainer Wittmann { 14837aed46aaSOliver-Rainer Wittmann mnBulletTypeIndex = nValue; 14847aed46aaSOliver-Rainer Wittmann } 14857aed46aaSOliver-Rainer Wittmann else if ( nSID == FN_NUM_NUM_RULE_INDEX ) 14867aed46aaSOliver-Rainer Wittmann { 14877aed46aaSOliver-Rainer Wittmann mnNumTypeIndex = nValue; 14887aed46aaSOliver-Rainer Wittmann } 14897aed46aaSOliver-Rainer Wittmann } 1490766ce4d0SZheng Fan } 14917aed46aaSOliver-Rainer Wittmann 14927aed46aaSOliver-Rainer Wittmann 1493766ce4d0SZheng Fan FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ) 1494766ce4d0SZheng Fan { 1495766ce4d0SZheng Fan FieldUnit eUnit = FUNIT_NONE; 1496766ce4d0SZheng Fan 1497766ce4d0SZheng Fan if ( pState && eState >= SFX_ITEM_DEFAULT ) 1498766ce4d0SZheng Fan eUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue(); 1499766ce4d0SZheng Fan else 1500766ce4d0SZheng Fan { 1501766ce4d0SZheng Fan SfxViewFrame* pFrame = SfxViewFrame::Current(); 1502766ce4d0SZheng Fan SfxObjectShell* pSh = NULL; 1503766ce4d0SZheng Fan if ( pFrame ) 1504766ce4d0SZheng Fan pSh = pFrame->GetObjectShell(); 1505766ce4d0SZheng Fan if ( pSh ) //the object shell is not always available during reload 1506766ce4d0SZheng Fan { 1507766ce4d0SZheng Fan SfxModule* pModule = pSh->GetModule(); 1508766ce4d0SZheng Fan if ( pModule ) 1509766ce4d0SZheng Fan { 1510766ce4d0SZheng Fan const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); 1511766ce4d0SZheng Fan if ( pItem ) 1512766ce4d0SZheng Fan eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); 1513766ce4d0SZheng Fan } 1514766ce4d0SZheng Fan else 1515766ce4d0SZheng Fan { 1516766ce4d0SZheng Fan DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" ); 1517766ce4d0SZheng Fan } 1518766ce4d0SZheng Fan } 1519766ce4d0SZheng Fan } 1520766ce4d0SZheng Fan 1521766ce4d0SZheng Fan return eUnit; 1522766ce4d0SZheng Fan } 15237aed46aaSOliver-Rainer Wittmann 1524766ce4d0SZheng Fan 1525766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateLineSpacingControl (PopupContainer* pParent) 1526766ce4d0SZheng Fan { 1527766ce4d0SZheng Fan return new ParaLineSpacingControl(pParent, *this); 1528766ce4d0SZheng Fan } 1529766ce4d0SZheng Fan 1530766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateBulletsPopupControl (PopupContainer* pParent) 1531766ce4d0SZheng Fan { 1532766ce4d0SZheng Fan return new ParaBulletsControl(pParent, *this); 1533766ce4d0SZheng Fan } 1534766ce4d0SZheng Fan 1535766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateNumberingPopupControl (PopupContainer* pParent) 1536766ce4d0SZheng Fan { 1537766ce4d0SZheng Fan return new ParaNumberingControl(pParent, *this); 1538766ce4d0SZheng Fan } 1539766ce4d0SZheng Fan 1540b7a56e95SArmin Le Grand namespace 1541b7a56e95SArmin Le Grand { 1542b7a56e95SArmin Le Grand Color GetNoBackgroundColor(void) 1543b7a56e95SArmin Le Grand { 1544b7a56e95SArmin Le Grand return COL_TRANSPARENT; 1545b7a56e95SArmin Le Grand } 1546b7a56e95SArmin Le Grand } // end of anonymous namespace 1547b7a56e95SArmin Le Grand 1548766ce4d0SZheng Fan PopupControl* ParaPropertyPanel::CreateBGColorPopupControl (PopupContainer* pParent) 1549766ce4d0SZheng Fan { 1550b7a56e95SArmin Le Grand const ResId aResId(SVX_RES(STR_NOFILL)); 1551b7a56e95SArmin Le Grand 1552b7a56e95SArmin Le Grand return new ColorControl( 1553766ce4d0SZheng Fan pParent, 1554766ce4d0SZheng Fan mpBindings, 1555b7a56e95SArmin Le Grand SVX_RES(RID_POPUPPANEL_PARAPAGE_BACK_COLOR), 1556766ce4d0SZheng Fan SVX_RES(VS_FONT_COLOR), 1557b7a56e95SArmin Le Grand ::boost::bind(GetNoBackgroundColor), 1558766ce4d0SZheng Fan ::boost::bind(&ParaPropertyPanel::SetBGColor, this, _1,_2), 1559766ce4d0SZheng Fan pParent, 1560b7a56e95SArmin Le Grand &aResId); 1561766ce4d0SZheng Fan } 1562766ce4d0SZheng Fan 1563766ce4d0SZheng Fan 1564766ce4d0SZheng Fan ParaPropertyPanel::ParaPropertyPanel(Window* pParent, 15653cac12cfSAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 156637fee4fdSAndre Fischer SfxBindings* pBindings, 156737fee4fdSAndre Fischer const cssu::Reference<css::ui::XSidebar>& rxSidebar) 156837fee4fdSAndre Fischer : Control(pParent, SVX_RES(RID_SIDEBAR_PARA_PANEL)), 1569*b6ab65a3SAndre Fischer mpAlignToolBoxBackground(ControlFactory::CreateToolBoxBackground(this)), 1570*b6ab65a3SAndre Fischer mpAlignToolBox (ControlFactory::CreateToolBox(mpAlignToolBoxBackground.get(),SVX_RES(TBX_HORIZONTALALIGNMENT))), 1571*b6ab65a3SAndre Fischer mpTBxVertAlignBackground(ControlFactory::CreateToolBoxBackground(this)), 1572*b6ab65a3SAndre Fischer mpTBxVertAlign (ControlFactory::CreateToolBox(mpTBxVertAlignBackground.get(),SVX_RES(TBX_VERT_ALIGN))), 1573*b6ab65a3SAndre Fischer mpTBxNumBulletBackground(ControlFactory::CreateToolBoxBackground(this)), 1574*b6ab65a3SAndre Fischer mpTBxNumBullet (ControlFactory::CreateToolBox(mpTBxNumBulletBackground.get(),SVX_RES(TBX_NUM_BULLET))), 1575*b6ab65a3SAndre Fischer mpTBxBackColorBackground(ControlFactory::CreateToolBoxBackground(this)), 1576*b6ab65a3SAndre Fischer mpTBxBackColor (ControlFactory::CreateToolBox(mpTBxBackColorBackground.get(),SVX_RES(TBX_BACK_COLOR))), 1577*b6ab65a3SAndre Fischer mpFTUL (new FixedText(this, SVX_RES(FT_SPACING))), 1578*b6ab65a3SAndre Fischer mpTbxUL_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), 1579*b6ab65a3SAndre Fischer mpTbxUL_IncDec (ControlFactory::CreateToolBox(mpTbxUL_IncDecBackground.get(),SVX_RES(TBX_UL_INC_DEC))), 1580*b6ab65a3SAndre Fischer mpTopDist (new SvxRelativeField(this, SVX_RES(MF_ABOVE_PARASPACING))), 1581*b6ab65a3SAndre Fischer mpBottomDist (new SvxRelativeField(this, SVX_RES(MF_BELOW_PARASPACING))), 1582*b6ab65a3SAndre Fischer mpLineSPTbxBackground(ControlFactory::CreateToolBoxBackground(this)), 1583*b6ab65a3SAndre Fischer mpLineSPTbx (ControlFactory::CreateToolBox(mpLineSPTbxBackground.get(),SVX_RES(TBX_LINESP))), 1584*b6ab65a3SAndre Fischer mpFTIndent (new FixedText(this, SVX_RES(FT_INDENT))), 1585*b6ab65a3SAndre Fischer mpTbxIndent_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), 1586*b6ab65a3SAndre Fischer mpTbxIndent_IncDec (ControlFactory::CreateToolBox(mpTbxIndent_IncDecBackground.get(),SVX_RES(TBX_INDENT_INC_DEC))), 1587*b6ab65a3SAndre Fischer mpTbxProDemoteBackground(ControlFactory::CreateToolBoxBackground(this)), 1588*b6ab65a3SAndre Fischer mpTbxProDemote (ControlFactory::CreateToolBox(mpTbxProDemoteBackground.get(),SVX_RES(TBX_INDENT_PRO_DEMOTE))), 1589*b6ab65a3SAndre Fischer mpLeftIndent (new SvxRelativeField(this, SVX_RES(MF_BEFORE_INDENT))), 1590*b6ab65a3SAndre Fischer mpRightIndent (new SvxRelativeField(this, SVX_RES(MF_AFTER_INDENT))), 1591*b6ab65a3SAndre Fischer mpFLineIndent (new SvxRelativeField(this, SVX_RES(MF_FL_INDENT))), 1592*b6ab65a3SAndre Fischer 159337fee4fdSAndre Fischer mpColorUpdater (), 159437fee4fdSAndre Fischer maFISpace1 ( this, SVX_RES( FI_SPACE1)), 159537fee4fdSAndre Fischer maFISpace2 ( this, SVX_RES( FI_SPACE2)), 159637fee4fdSAndre Fischer maFIndent1 ( this, SVX_RES( FI_INDENT1)), 159737fee4fdSAndre Fischer maFIndent2 ( this, SVX_RES( FI_INDENT2)), 159837fee4fdSAndre Fischer maFIndent3 ( this, SVX_RES( FI_INDENT3)), 159937fee4fdSAndre Fischer maSpace1 (SVX_RES(IMG_SPACE1)), 160037fee4fdSAndre Fischer maSpace2 (SVX_RES(IMG_SPACE2)), 160137fee4fdSAndre Fischer maSpace3 (SVX_RES(IMG_SPACE3)), 160237fee4fdSAndre Fischer maIndent1 (SVX_RES(IMG_INDENT1)), 160337fee4fdSAndre Fischer maIndent2 (SVX_RES(IMG_INDENT2)), 160437fee4fdSAndre Fischer maIndent3 (SVX_RES(IMG_INDENT3)), 160537fee4fdSAndre Fischer maIndHang (SVX_RES(IMG_INDENT_HANG)), 160637fee4fdSAndre Fischer maNumBImageList (SVX_RES(IL_NUM_BULLET)), 160737fee4fdSAndre Fischer maNumBImageListH (SVX_RES(ILH_NUM_BULLET)), 160837fee4fdSAndre Fischer maNumBImageListRTL (SVX_RES(IL_NUM_BULLET_RTL)), 160937fee4fdSAndre Fischer maImgBackColorHigh (SVX_RES(IMG_BACK_COLOR_H)), 161037fee4fdSAndre Fischer maImgBackColor (SVX_RES(IMG_BACK_COLOR)), 161137fee4fdSAndre Fischer maTxtLeft (0), 161237fee4fdSAndre Fischer mpLnSPItem (NULL), 161337fee4fdSAndre Fischer meLnSpState (SFX_ITEM_DONTCARE), 161437fee4fdSAndre Fischer mbOutLineLeft (false), 161537fee4fdSAndre Fischer mbOutLineRight (false), 161637fee4fdSAndre Fischer maUpper (0), 161737fee4fdSAndre Fischer maLower (0), 161837fee4fdSAndre Fischer mnBulletTypeIndex ((sal_uInt16)0xFFFF), 161937fee4fdSAndre Fischer mnNumTypeIndex ((sal_uInt16)0xFFFF), 162037fee4fdSAndre Fischer maColor (COL_AUTO), 162137fee4fdSAndre Fischer mbColorAvailable (true), 162237fee4fdSAndre Fischer m_eLRSpaceUnit(), 162337fee4fdSAndre Fischer m_eULSpaceUnit(), 16243cac12cfSAndre Fischer maLeftAlignControl(SID_ATTR_PARA_ADJUST_LEFT, *pBindings, *this, A2S("LeftPara"), rxFrame), 16253cac12cfSAndre Fischer maCenterAlignControl(SID_ATTR_PARA_ADJUST_CENTER, *pBindings, *this, A2S("CenterPara"), rxFrame), 16263cac12cfSAndre Fischer maRightAlignControl(SID_ATTR_PARA_ADJUST_RIGHT, *pBindings, *this, A2S("RightPara"), rxFrame), 16273cac12cfSAndre Fischer maJustifyAlignControl(SID_ATTR_PARA_ADJUST_BLOCK, *pBindings, *this, A2S("JustifyPara"), rxFrame), 162837fee4fdSAndre Fischer maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this), 162937fee4fdSAndre Fischer maLNSpaceControl (SID_ATTR_PARA_LINESPACE, *pBindings,*this), 163037fee4fdSAndre Fischer maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this), 16313cac12cfSAndre Fischer maOutLineLeftControl(SID_OUTLINE_LEFT, *pBindings, *this, A2S("OutlineRight"), rxFrame), 16323cac12cfSAndre Fischer maOutLineRightControl(SID_OUTLINE_RIGHT, *pBindings, *this, A2S("OutlineLeft"), rxFrame), 16333cac12cfSAndre Fischer maDecIndentControl(SID_DEC_INDENT, *pBindings,*this, A2S("DecrementIndent"), rxFrame), 16343cac12cfSAndre Fischer maIncIndentControl(SID_INC_INDENT, *pBindings,*this, A2S("IncrementIndent"), rxFrame), 16353cac12cfSAndre Fischer maVertTop (SID_TABLE_VERT_NONE, *pBindings, *this, A2S("CellVertTop"), rxFrame), 16363cac12cfSAndre Fischer maVertCenter (SID_TABLE_VERT_CENTER, *pBindings,*this, A2S("CellVertCenter"), rxFrame), 16373cac12cfSAndre Fischer maVertBottom (SID_TABLE_VERT_BOTTOM,*pBindings,*this, A2S("CellVertBottom"), rxFrame), 16383cac12cfSAndre Fischer maBulletOnOff(FN_NUM_BULLET_ON, *pBindings, *this, A2S("DefaultBullet"), rxFrame), 16393cac12cfSAndre Fischer maNumberOnOff(FN_NUM_NUMBERING_ON, *pBindings, *this, A2S("DefaultNumbering"), rxFrame), 164037fee4fdSAndre Fischer maBackColorControl (SID_BACKGROUND_COLOR, *pBindings,*this), 164137fee4fdSAndre Fischer m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this), 164237fee4fdSAndre Fischer maBulletNumRuleIndex (FN_BUL_NUM_RULE_INDEX, *pBindings,*this), 164337fee4fdSAndre Fischer maNumNumRuleIndex (FN_NUM_NUM_RULE_INDEX, *pBindings,*this), 16448cdef556SPavel Janík mxFrame(rxFrame), 164537fee4fdSAndre Fischer maContext(), 164637fee4fdSAndre Fischer mpBindings(pBindings), 164737fee4fdSAndre Fischer maLineSpacePopup(this, ::boost::bind(&ParaPropertyPanel::CreateLineSpacingControl, this, _1)), 164837fee4fdSAndre Fischer maBulletsPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBulletsPopupControl, this, _1)), 164937fee4fdSAndre Fischer maNumberingPopup(this, ::boost::bind(&ParaPropertyPanel::CreateNumberingPopupControl, this, _1)), 165037fee4fdSAndre Fischer maBGColorPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBGColorPopupControl, this, _1)), 165137fee4fdSAndre Fischer mxSidebar(rxSidebar) 1652766ce4d0SZheng Fan { 1653766ce4d0SZheng Fan initial(); 16543cac12cfSAndre Fischer FreeResource(); 1655766ce4d0SZheng Fan } 1656766ce4d0SZheng Fan 165737fee4fdSAndre Fischer } } // end of namespace svx::sidebar 1658