openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zheng...@apache.org
Subject svn commit: r1463154 [5/6] - in /openoffice/branches/sidebar/main: editeng/inc/editeng/ editeng/source/outliner/ officecfg/registry/data/org/openoffice/Office/UI/ sc/sdi/ sc/source/ui/app/ sc/source/ui/docshell/ sc/source/ui/drawfunc/ sc/source/ui/view...
Date Mon, 01 Apr 2013 14:43:35 GMT
Added: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx?rev=1463154&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx Mon Apr  1 14:43:34 2013
@@ -0,0 +1,1697 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_svx.hxx"
+#include <svx/sidebar/ColorControl.hxx>
+
+#include "ParaPropertyPanel.hxx"
+#include "ParaPropertyPanel.hrc"
+
+#include "ParaLineSpacingPopup.hxx"
+#include "ParaLineSpacingControl.hxx"
+#include "ParaBulletsPopup.hxx"
+#include "ParaBulletsControl.hxx"
+#include "ParaNumberingPopup.hxx"
+#include "ParaNumberingControl.hxx"
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/propertypanel.hrc>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include <svx/sidebar/PopupContainer.hxx>
+#include <sfx2/dispatch.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/svxids.hrc>
+#include <svl/intitem.hxx>
+#include "svx/dialmgr.hxx"
+#include <sfx2/objsh.hxx>
+#include <svtools/unitconv.hxx>
+#include <boost/bind.hpp>
+using namespace css;
+using namespace cssu;
+using ::sfx2::sidebar::Theme;
+using ::sfx2::sidebar::ControlFactory;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
+
+namespace svx {namespace sidebar {
+#define DEFAULT_VALUE          0
+#define TOOLBOX_ITEM1          1
+#define TOOLBOX_ITEM2          2
+#define TOOLBOX_ITEM3          3
+#define TOOLBOX_ITEM4          4
+
+#define MAX_DURCH             5670
+
+#define INDENT_INCREMENT       1
+#define INDENT_DECREMENT       2
+#define INDENT_STEP            706
+#define UL_STEP                58
+#define UL_INCREMENT           1
+#define UL_DECREMENT           2
+
+#define NEGATIVE_MAX_VALUE              -9999
+#define BEGIN_VALUE            28
+#define MAX_SW                  1709400
+#define MAX_SC_SD				116220200
+#define NEGA_MAXVALUE          -10000000
+
+#define POS_FT_PARA_SPACE								Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y), MAP_APPFONT))
+#define POS_FT_PARA_SPACE2								Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y2), MAP_APPFONT))
+#define POS_TBX_PARA_SPACE_INC_DEC						Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y), MAP_APPFONT))
+#define POS_TBX_PARA_SPACE_INC_DEC2						Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y2), MAP_APPFONT))
+#define POS_FT_PARA_INDENT								Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y), MAP_APPFONT))
+#define POS_FT_PARA_INDENT2								Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y2), MAP_APPFONT))
+#define POS_TBX_PARA_INDENT_INC_DEC						Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y), MAP_APPFONT))
+#define POS_TBX_PARA_INDENT_INC_DEC2					Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y2), MAP_APPFONT))
+#define POS_MBX_TOP_DIST								Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y), MAP_APPFONT))
+#define POS_MBX_TOP_DIST2								Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y2), MAP_APPFONT))
+#define POS_MBX_BOT_DIST								Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y), MAP_APPFONT))
+#define POS_MBX_BOT_DIST2								Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y2), MAP_APPFONT))
+#define POS_MBX_LEFT_DIST								Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y), MAP_APPFONT))
+#define POS_MBX_LEFT_DIST2								Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y2), MAP_APPFONT))
+#define POS_MBX_RIGHT_DIST								Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y), MAP_APPFONT))
+#define POS_MBX_RIGHT_DIST2								Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y2), MAP_APPFONT))
+#define POS_MBX_FLINE_DIST								Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y), MAP_APPFONT))
+#define POS_MBX_FLINE_DIST2								Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y2), MAP_APPFONT))
+#define POS_IMG_SPACE1									Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y), MAP_APPFONT))
+#define POS_IMG_SPACE12									Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y2), MAP_APPFONT))
+#define POS_IMG_SPACE2									Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y), MAP_APPFONT))
+#define POS_IMG_SPACE22									Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y2), MAP_APPFONT))
+#define POS_IMG_INDENT1									Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y), MAP_APPFONT))
+#define POS_IMG_INDENT12								Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y2), MAP_APPFONT))
+#define POS_IMG_INDENT2									Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y), MAP_APPFONT))
+#define POS_IMG_INDENT22								Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y2), MAP_APPFONT))
+#define POS_IMG_INDENT3									Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y), MAP_APPFONT))
+#define POS_IMG_INDENT32								Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y2), MAP_APPFONT))
+#define TBX_LINE_SPACE									Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y), MAP_APPFONT))
+#define TBX_LINE_SPACE2									Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y2), MAP_APPFONT))
+
+#define LINE_POINT1_WHITE								Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y), MAP_APPFONT))
+#define LINE_POINT2_WHITE								Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y), MAP_APPFONT))
+#define LINE_POINT3_WHITE								Point(LogicToPixel(Point(LINE_X_WHITE,LINE_TOP_Y2), MAP_APPFONT))
+#define LINE_POINT4_WHITE								Point(LogicToPixel(Point(LINE_X_WHITE,LINE_BOT_Y2), MAP_APPFONT))
+
+ParaPropertyPanel* ParaPropertyPanel::Create (
+    Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+{
+    if (pParent == NULL)
+        throw lang::IllegalArgumentException(A2S("no parent Window given to ParaPropertyPanel::Create"), NULL, 0);
+    if ( ! rxFrame.is())
+        throw lang::IllegalArgumentException(A2S("no XFrame given to ParaPropertyPanel::Create"), NULL, 1);
+    if (pBindings == NULL)
+        throw lang::IllegalArgumentException(A2S("no SfxBindings given to ParaPropertyPanel::Create"), NULL, 2);
+    
+    return new ParaPropertyPanel(
+        pParent,
+        rxFrame,
+        pBindings);
+}
+
+void ParaPropertyPanel::HandleContextChange (
+    const ::sfx2::sidebar::EnumContext aContext)
+{
+    if (maContext == aContext)
+    {
+        // Nothing to do.
+        return;
+    }
+
+    maContext = aContext;
+    switch (maContext.GetCombinedContext())
+    {
+        case CombinedEnumContext(Application_Calc, Context_DrawText):
+	{
+		maTBxVertAlign->Show();
+		maTBxVertAlignBackground->Show();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Hide();
+		maTBxNumBulletBackground->Hide();
+		ReSize(0);
+		maTbxIndent_IncDec->Show();
+		maTbxIndent_IncDecBackground->Show();
+		maTbxProDemote->Hide();
+		maTbxProDemoteBackground->Hide();
+	}
+	break;
+        case CombinedEnumContext(Application_Draw, Context_Draw):
+        case CombinedEnumContext(Application_Draw, Context_TextObject):
+        case CombinedEnumContext(Application_Draw, Context_Graphic):
+        case CombinedEnumContext(Application_Impress, Context_Draw):
+        case CombinedEnumContext(Application_Impress, Context_TextObject):
+        case CombinedEnumContext(Application_Impress, Context_Graphic):
+	{
+		maTBxVertAlign->Hide();
+		maTBxVertAlignBackground->Hide();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Show();
+		maTBxNumBulletBackground->Show();
+		ReSize(1);
+		maTbxIndent_IncDec->Hide();
+		maTbxIndent_IncDecBackground->Hide();
+		maTbxProDemote->Show();
+		maTbxProDemoteBackground->Show();
+	}
+	break;
+        case CombinedEnumContext(Application_Draw, Context_DrawText):
+        case CombinedEnumContext(Application_Impress, Context_DrawText):
+	{
+		maTBxVertAlign->Show();
+		maTBxVertAlignBackground->Show();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Show();
+		maTBxNumBulletBackground->Show();
+		ReSize(1);
+		maTbxIndent_IncDec->Hide();
+		maTbxIndent_IncDecBackground->Hide();
+		maTbxProDemote->Show();
+		maTbxProDemoteBackground->Show();
+	}
+	break;
+        case CombinedEnumContext(Application_Impress, Context_Table):
+        case CombinedEnumContext(Application_Draw, Context_Table):
+	{
+		maTBxVertAlign->Show();
+		maTBxVertAlignBackground->Show();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Show();
+		maTBxNumBulletBackground->Show();
+		ReSize(1);
+		maTbxIndent_IncDec->Hide();
+		maTbxIndent_IncDecBackground->Hide();
+		maTbxProDemote->Show();
+		maTbxProDemoteBackground->Show();
+	}
+	break;
+	case CombinedEnumContext(Application_Writer, Context_Default):
+        case CombinedEnumContext(Application_Writer, Context_Text):
+	{
+		maTBxVertAlign->Hide();
+		maTBxVertAlignBackground->Hide();
+		maTBxBackColor->Show();
+		maTBxBackColorBackground->Show();
+		maTBxNumBullet->Show();
+		
+		maTBxNumBulletBackground->Show();
+		ReSize(1);
+		maTbxIndent_IncDec->Show();
+		maTbxIndent_IncDecBackground->Show();
+		maTbxProDemote->Hide();
+		maTbxProDemoteBackground->Hide();
+	}
+	break;
+        case CombinedEnumContext(Application_Writer, Context_Table):
+        {
+		maTBxVertAlign->Show();
+		maTBxVertAlignBackground->Show();
+		maTBxBackColor->Show();
+		maTBxBackColorBackground->Show();
+		maTBxNumBullet->Show();
+		maTBxNumBulletBackground->Show();
+		ReSize(1);
+		maTbxIndent_IncDec->Show();
+		maTbxIndent_IncDecBackground->Show();
+		maTbxProDemote->Hide();
+		maTbxProDemoteBackground->Hide();
+        }
+	break;
+        case CombinedEnumContext(Application_Writer, Context_DrawText):
+	{
+		maTBxVertAlign->Show();
+		maTBxVertAlignBackground->Show();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Hide();
+		maTBxNumBulletBackground->Hide();
+		ReSize(0);
+		maTbxIndent_IncDec->Show();
+		maTbxIndent_IncDecBackground->Show();
+		maTbxProDemote->Hide();
+		maTbxProDemoteBackground->Hide();
+	}
+	break;
+        case CombinedEnumContext(Application_Writer, Context_Annotation):
+        {
+		maTBxVertAlign->Hide();
+		maTBxVertAlignBackground->Hide();
+		maTBxBackColor->Hide();
+		maTBxBackColorBackground->Hide();
+		maTBxNumBullet->Hide();
+		maTBxNumBulletBackground->Hide();
+		ReSize(0);
+		maTbxIndent_IncDec->Show();
+		maTbxIndent_IncDecBackground->Show();
+		maTbxProDemote->Hide();
+		maTbxProDemoteBackground->Hide();
+        }
+	break;
+        case CombinedEnumContext(Application_Calc, Context_EditCell):
+        case CombinedEnumContext(Application_Draw, Context_Text):
+        case CombinedEnumContext(Application_Draw, Context_OutlineText):
+        case CombinedEnumContext(Application_Calc, Context_Cell):
+        case CombinedEnumContext(Application_Calc, Context_Pivot):
+        case CombinedEnumContext(Application_Impress, Context_Text):
+        case CombinedEnumContext(Application_Impress, Context_OutlineText):
+        /*{
+            mpToolBoxScriptSw->Hide();
+            mpToolBoxScript->Show();
+            mpToolBoxSpacing->Show();
+            mpToolBoxHighlight->Hide();
+
+            Size aSize(PROPERTYPAGE_WIDTH,TEXT_SECTIONPAGE_HEIGHT);
+            aSize = LogicToPixel( aSize,MapMode(MAP_APPFONT) ); 
+            aSize.setWidth(GetOutputSizePixel().Width());
+            SetSizePixel(aSize);
+            break;
+        }*/
+
+        default:
+            break;
+    }
+}
+
+SfxBindings* ParaPropertyPanel::GetBindings() 
+{ 
+    return mpBindings; 
+}
+
+void ParaPropertyPanel::SetupIcons (void)
+{
+    if (Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
+    {
+    }
+    else
+    {
+    }
+}
+
+void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
+{
+    (void)rEvent;
+    
+    SetupIcons();
+}
+
+ParaPropertyPanel::~ParaPropertyPanel()
+{
+	delete mpLnSPItem;
+}
+
+void ParaPropertyPanel::ReSize(bool bSize)
+{
+	if(bSize)
+	{
+		//Paragraph spacing
+		maFTUL->SetPosPixel(POS_FT_PARA_SPACE);
+		maTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC);
+		maTopDist->SetPosPixel(POS_MBX_TOP_DIST);
+		maBottomDist->SetPosPixel(POS_MBX_BOT_DIST);
+		//Indent
+		maFTIndent->SetPosPixel(POS_FT_PARA_INDENT);
+		maTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC);
+		maTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC);
+		maLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST);
+		maRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST);
+		maFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST);
+		//Line spacing
+		maLineSPTbx->SetPosPixel(TBX_LINE_SPACE);
+		//image
+		maFISpace1.SetPosPixel(POS_IMG_SPACE1);
+		maFISpace2.SetPosPixel(POS_IMG_SPACE2);
+		maFIndent1.SetPosPixel(POS_IMG_INDENT1);
+		maFIndent2.SetPosPixel(POS_IMG_INDENT2);
+		maFIndent3.SetPosPixel(POS_IMG_INDENT3);
+		Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT);
+		aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); 
+		aSize.setWidth(GetOutputSizePixel().Width());
+		SetSizePixel(aSize);
+	}
+	else
+	{
+		//Paragraph spacing
+		maFTUL->SetPosPixel(POS_FT_PARA_SPACE2);
+		maTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC2);
+		maTopDist->SetPosPixel(POS_MBX_TOP_DIST2);
+		maBottomDist->SetPosPixel(POS_MBX_BOT_DIST2);
+		//Indent
+		maFTIndent->SetPosPixel(POS_FT_PARA_INDENT2);
+		maTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2);
+		maTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2);
+		maLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST2);
+		maRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST2);
+		maFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST2);
+		//Line spacing
+		maLineSPTbx->SetPosPixel(TBX_LINE_SPACE2);
+		//image
+		maFISpace1.SetPosPixel(POS_IMG_SPACE12);
+		maFISpace2.SetPosPixel(POS_IMG_SPACE22);
+		maFIndent1.SetPosPixel(POS_IMG_INDENT12);
+		maFIndent2.SetPosPixel(POS_IMG_INDENT22);
+		maFIndent3.SetPosPixel(POS_IMG_INDENT32);
+		Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT_2);
+		aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
+		aSize.setWidth(GetOutputSizePixel().Width());
+		SetSizePixel(aSize);
+	}
+}
+
+void ParaPropertyPanel::EndSpacingPopupMode (void)
+{
+    maLineSpacePopup.Hide();
+}
+
+void ParaPropertyPanel::EndBulletsPopupMode (void)
+{
+	//maUnderlinePopup.Hide();
+}
+
+void ParaPropertyPanel::EndNumberingPopupMode (void)
+{
+	//maUnderlinePopup.Hide();
+}
+
+
+void ParaPropertyPanel::InitToolBoxAlign()
+{
+	maAlignToolBox->SetItemImage(TOOLBOX_ITEM1,maLeftPara);
+	maAlignToolBox->SetItemImage(TOOLBOX_ITEM2,maCentPara);
+	maAlignToolBox->SetItemImage(TOOLBOX_ITEM3,maRightPara);
+	maAlignToolBox->SetItemImage(TOOLBOX_ITEM4,maJusPara);
+	Link aLink = LINK( this, ParaPropertyPanel, AlignStyleModifyHdl_Impl );
+	maAlignToolBox->SetSelectHdl( aLink );
+	Size aTbxSize (maAlignToolBox->CalcWindowSizePixel());
+	maAlignToolBox->SetOutputSizePixel( aTbxSize );
+}
+
+void ParaPropertyPanel::InitToolBoxVertAlign()
+{
+	InitImageList(maTBxVertAlign, maVertImageList, maVertImageListH);
+	maTBxVertAlign->SetSelectHdl(LINK(this,ParaPropertyPanel,VertTbxSelectHandler));
+	Size aTbxSize (maTBxVertAlign->CalcWindowSizePixel());
+	maTBxVertAlign->SetOutputSizePixel( aTbxSize );
+}
+
+
+void ParaPropertyPanel::InitToolBoxIndent()
+{
+	Link aLink = LINK( this, ParaPropertyPanel, ModifyIndentHdl_Impl );
+	maLeftIndent->SetModifyHdl( aLink );
+	maRightIndent->SetModifyHdl( aLink );
+	maFLineIndent->SetModifyHdl( aLink );
+
+	if( Application::GetSettings().GetLayoutRTL())
+	{
+		maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1,maIndInc_BD);
+		maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2,maIndDec_BD);
+	}
+	else
+	{
+		maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1,maIndInc);
+		maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2,maIndDec);
+	}
+	maTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM3,maIndHang);
+	aLink = LINK( this, ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl );
+	maTbxIndent_IncDec->SetSelectHdl(aLink);    
+	m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
+	Size aTbxSize = maTbxIndent_IncDec->CalcWindowSizePixel();
+	maTbxIndent_IncDec->SetOutputSizePixel( aTbxSize );
+	
+	if( Application::GetSettings().GetLayoutRTL())
+	{
+		maTbxProDemote->SetItemImage(TOOLBOX_ITEM1,maIndInc_BD);
+		maTbxProDemote->SetItemImage(TOOLBOX_ITEM2,maIndDec_BD);
+	}
+	else
+	{
+		maTbxProDemote->SetItemImage(TOOLBOX_ITEM1,maIndInc);
+		maTbxProDemote->SetItemImage(TOOLBOX_ITEM2,maIndDec);
+	}
+	maTbxProDemote->SetItemImage(TOOLBOX_ITEM3,maIndHang);
+	aLink = LINK( this, ParaPropertyPanel, ClickProDemote_Hdl_Impl );
+	maTbxProDemote->SetSelectHdl(aLink);    
+	m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
+	aTbxSize = maTbxProDemote->CalcWindowSizePixel();
+	maTbxProDemote->SetOutputSizePixel( aTbxSize );
+}
+
+void ParaPropertyPanel::InitToolBoxBGColor()
+{
+	mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, maTBxBackColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW ));
+
+	maTBxBackColor->SetItemImage(TBI_BACK_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor);
+	maTBxBackColor->SetItemBits( TBI_BACK_COLOR, maTBxBackColor->GetItemBits( TBI_BACK_COLOR ) | TIB_DROPDOWNONLY );
+
+	Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler);
+	maTBxBackColor->SetDropdownClickHdl ( aLink );
+	maTBxBackColor->SetSelectHdl ( aLink );
+	Size aTbxSize (maTBxBackColor->CalcWindowSizePixel());
+	maTBxBackColor->SetOutputSizePixel( aTbxSize );
+}
+
+void ParaPropertyPanel::InitToolBoxBulletsNumbering()
+{
+	if( Application::GetSettings().GetLayoutRTL())//sym2_7380
+	{
+		maTBxNumBullet->SetItemImage( IID_BULLET, maNumBImageListRTL.GetImage( IID_BULLET ) );
+		maTBxNumBullet->SetItemImage( IID_NUMBER, maNumBImageListRTL.GetImage( IID_NUMBER ) );
+	}
+	else
+		InitImageList(maTBxNumBullet, maNumBImageList, maNumBImageListH);
+
+	maTBxNumBullet->SetDropdownClickHdl(LINK(this,ParaPropertyPanel,NumBTbxDDHandler));
+	maTBxNumBullet->SetSelectHdl(LINK(this,ParaPropertyPanel,NumBTbxSelectHandler));
+	Size aTbxSize (maTBxNumBullet->CalcWindowSizePixel());
+	maTBxNumBullet->SetOutputSizePixel( aTbxSize );
+}
+void ParaPropertyPanel::InitToolBoxSpacing()
+{
+	Link aLink = LINK( this, ParaPropertyPanel, ULSpaceHdl_Impl );
+	maTopDist->SetModifyHdl(aLink);
+	maBottomDist->SetModifyHdl( aLink );
+
+	maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM1,maParInc);
+	maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM2,maParDec);
+	aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl );
+	maTbxUL_IncDec->SetSelectHdl(aLink);
+	m_eULSpaceUnit = maULSpaceControl.GetCoreMetric();
+	Size aTbxSize = maTbxUL_IncDec->CalcWindowSizePixel();
+	maTbxUL_IncDec->SetOutputSizePixel( aTbxSize );
+}
+void ParaPropertyPanel::InitToolBoxLineSpacing()
+{
+	Link aLink = LINK( this, ParaPropertyPanel, ClickLineSPDropDownHdl_Impl );
+	maLineSPTbx->SetDropdownClickHdl( aLink );
+	maLineSPTbx->SetSelectHdl( aLink );		//support keyinput "ENTER"
+	maLineSPTbx->SetItemBits( TOOLBOX_ITEM1, maLineSPTbx->GetItemBits( TOOLBOX_ITEM1 ) | TIB_DROPDOWNONLY );
+	maLineSPTbx->SetItemImage(TOOLBOX_ITEM1,maSpace3);
+	Size aTbxSize = maLineSPTbx->CalcWindowSizePixel();
+	maLineSPTbx->SetOutputSizePixel( aTbxSize );
+}
+
+void ParaPropertyPanel::initial()
+{
+	maFISpace1.SetImage(maSpace1);
+	maFISpace2.SetImage(maSpace2);
+	maFIndent1.SetImage(maIndent3);
+	maFIndent2.SetImage(maIndent2);
+	maFIndent3.SetImage(maIndent1);
+
+	GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_LEFT,sal_True,sal_False);
+	GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_CENTER,sal_True,sal_False);
+	GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_RIGHT,sal_True,sal_False);
+	GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_BLOCK,sal_True,sal_False);
+
+	//toolbox
+	SetupIcons();
+	InitToolBoxAlign();
+	InitToolBoxVertAlign();
+	InitToolBoxIndent();
+	InitToolBoxBGColor();
+	InitToolBoxBulletsNumbering();
+	InitToolBoxSpacing();
+	InitToolBoxLineSpacing();
+
+#ifdef HAS_IA2
+	maAlignToolBox->SetAccRelationLabeledBy(&maAlignToolBox);
+	maTBxVertAlign->SetMpSubEditAccLableBy(&maTBxVertAlign);
+	maTBxNumBullet->SetAccRelationLabeledBy(&maTBxNumBullet);
+	maTBxBackColor->SetMpSubEditAccLableBy(&maTBxBackColor);
+	maFTUL->SetAccRelationLabeledBy(&maFTUL);
+	maTbxUL_IncDec->SetAccRelationLabeledBy(&maTbxUL_IncDec);
+	maTopDist->SetAccRelationLabeledBy(&maTopDist);
+	maBottomDist->SetAccRelationLabeledBy(&maBottomDist);
+	maLineSPTbx->SetAccRelationLabeledBy(&maLineSPTbx);
+	maFTIndent->SetAccRelationLabeledBy(&maFTIndent);
+	maTbxIndent_IncDec->SetAccRelationLabeledBy(&maTbxIndent_IncDec);
+	maTbxProDemote->SetAccRelationLabeledBy(&maTbxProDemote);
+	maLeftIndent->SetAccRelationLabeledBy(&maLeftIndent);
+	maRightIndent->SetAccRelationLabeledBy(&maRightIndent);
+	maFLineIndent->SetAccRelationLabeledBy(&maFLineIndent);
+	mpColorUpdater->SetAccRelationLabeledBy(&mpColorUpdater);
+#endif	
+}
+
+void ParaPropertyPanel::InitImageList(::boost::scoped_ptr<ToolBox>& rTbx, ImageList& rImglst, ImageList& rImgHlst)
+{	
+	sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
+
+    ImageList& rImgLst = bHighContrast ? rImgHlst : rImglst;
+
+	sal_uInt16 nCount = rTbx->GetItemCount();
+    for (sal_uInt16 i = 0; i < nCount; i++)
+    {
+    	sal_uInt16 nId = rTbx->GetItemId(i);
+		rTbx->SetItemImage( nId, rImgLst.GetImage( nId ) );
+    }
+}
+
+//===========================for Numbering & Bullet================================================
+
+
+
+IMPL_LINK(ParaPropertyPanel, NumBTbxDDHandler, ToolBox*, pToolBox)
+{
+	sal_uInt16 nId = pToolBox->GetCurItemId();
+	
+	EndTracking();
+	pToolBox->SetItemDown( nId, sal_True ); 
+
+	if (nId == 1)
+    {
+		maBulletsPopup.UpdateValueSet();
+		maBulletsPopup.Show(*pToolBox);
+	}
+	else if (nId == 2)
+	{
+		maNumberingPopup.UpdateValueSet();
+		maNumberingPopup.Show(*pToolBox);
+	}
+	pToolBox->SetItemDown( nId, sal_False ); 
+	return 0;
+}
+
+IMPL_LINK(ParaPropertyPanel, NumBTbxSelectHandler, ToolBox*, pToolBox)
+{
+	sal_uInt16 nId = pToolBox->GetCurItemId();
+	sal_uInt16 nSID = SID_TABLE_VERT_NONE;
+	
+	EndTracking();
+	if (nId == 1)
+    {
+		nSID = FN_NUM_BULLET_ON;
+	}
+	else if ( nId == 2)
+	{
+		nSID = FN_NUM_NUMBERING_ON;
+	}
+	SfxBoolItem aBoolItem(nSID, sal_True);
+	GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+
+	return 0;	
+}
+
+
+//================================for Vertical Alignment========================================
+
+
+
+IMPL_LINK(ParaPropertyPanel, VertTbxSelectHandler, ToolBox*, pToolBox)
+{
+	sal_uInt16 nId = pToolBox->GetCurItemId();
+	sal_uInt16 nSID = SID_TABLE_VERT_NONE;
+	EndTracking();
+	if (nId == 1)
+    {
+        nSID = SID_TABLE_VERT_NONE;
+		maTBxVertAlign->SetItemState(1, STATE_CHECK);
+		maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+	}
+	else if (nId == 2)
+	{
+		nSID = SID_TABLE_VERT_CENTER;
+		maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(2, STATE_CHECK);
+		maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+	}
+	else if (nId == 3)
+	{
+		nSID = SID_TABLE_VERT_BOTTOM;
+		maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(3, STATE_CHECK);
+	}
+	SfxBoolItem aBoolItem(nSID, sal_True);
+	GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+
+	return 0;
+}
+
+void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
+{	
+	if (eState < SFX_ITEM_DONTCARE)
+	{
+		maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+		maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+		maTBxVertAlign->EnableItem(1, sal_False);
+		maTBxVertAlign->EnableItem(2, sal_False);
+		maTBxVertAlign->EnableItem(3, sal_False);
+	}
+	else
+	{
+		maTBxVertAlign->EnableItem(1, sal_True);
+		maTBxVertAlign->EnableItem(2, sal_True);
+		maTBxVertAlign->EnableItem(3, sal_True);
+		if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)))
+		{
+			const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
+			sal_Bool aBool = (sal_Bool)pItem->GetValue();
+
+			if (aBool)
+			{
+				if (nSID == SID_TABLE_VERT_NONE)
+				{
+					maTBxVertAlign->SetItemState(1, STATE_CHECK);
+					maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+					maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+				}
+				else if (nSID == SID_TABLE_VERT_CENTER)
+				{
+					maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+					maTBxVertAlign->SetItemState(2, STATE_CHECK);
+					maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+				}
+				else if (nSID == SID_TABLE_VERT_BOTTOM)
+				{
+					maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+					maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+					maTBxVertAlign->SetItemState(3, STATE_CHECK);
+				}
+			}
+			else
+			{
+				if (nSID == SID_TABLE_VERT_NONE)
+				{
+					maTBxVertAlign->SetItemState(1, STATE_NOCHECK);					
+				}
+				else if (nSID == SID_TABLE_VERT_CENTER)
+				{					
+					maTBxVertAlign->SetItemState(2, STATE_NOCHECK);				
+				}
+				else if (nSID == SID_TABLE_VERT_BOTTOM)
+				{					
+					maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+				}
+			}
+		}
+		else
+		{
+			maTBxVertAlign->SetItemState(1, STATE_NOCHECK);
+			maTBxVertAlign->SetItemState(2, STATE_NOCHECK);
+			maTBxVertAlign->SetItemState(3, STATE_NOCHECK);
+		}
+	}
+}
+//==================================for Background color=====================
+
+IMPL_LINK(ParaPropertyPanel, ToolBoxBackColorDDHandler,ToolBox*, pToolBox)
+{
+	sal_uInt16 nId = pToolBox->GetCurItemId();
+	OSL_ASSERT(nId == TBI_BACK_COLOR);
+	if(nId == TBI_BACK_COLOR)
+	{
+		pToolBox->SetItemDown( nId, true );
+		maBGColorPopup.Show(*pToolBox);
+		maBGColorPopup.SetCurrentColor(maColor, mbColorAvailable);
+	}
+	return 0;
+}
+
+IMPL_LINK( ParaPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
+{	
+	return 0;
+}
+
+void ParaPropertyPanel::ShowMenu (void)
+{
+    if (mpBindings != NULL)
+    {
+        SfxDispatcher* pDispatcher = mpBindings->GetDispatcher();
+        if (pDispatcher != NULL)
+            pDispatcher->Execute(SID_PARA_DLG, SFX_CALLMODE_ASYNCHRON);
+    }
+}
+
+void ParaPropertyPanel::ParaBKGStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState)
+{
+	if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxBrushItem))
+	{
+		const SvxBrushItem* pItem =  (const SvxBrushItem*)pState;
+		maColor = pItem->GetColor();
+		mbColorAvailable = sal_True;
+		mpColorUpdater->Update(maColor);
+	}
+	else
+	{
+		mbColorAvailable = sal_False;
+		maColor.SetColor(COL_AUTO);
+		mpColorUpdater->Update(maColor);
+	}
+}
+
+Color ParaPropertyPanel::GetBGColor (void) const
+{
+    return maColor;
+}
+
+void ParaPropertyPanel::SetBGColor (
+    const String& rsColorName,
+    const Color aColor)
+{
+	SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR);
+	mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
+	maColor = aColor;
+}
+
+//==================================for Paragraph Alignment=====================
+IMPL_LINK( ParaPropertyPanel, AlignStyleModifyHdl_Impl, ToolBox*, pBox )
+{
+	switch (pBox->GetCurItemId())
+	{
+	case BT_SUBSTLEFT:
+		{
+			pBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK);
+			pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+			SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_LEFT,  sal_True );
+			GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_LEFT, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+		}
+		break;
+	case BT_SUBSTCENTER:
+		{
+			pBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK);
+			pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+			SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True );
+			GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_CENTER, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+		}
+		break;
+	case BT_SUBSTRIGHT:
+		{
+			pBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK);
+			pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+			SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True );
+			GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_RIGHT, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+		}
+		break;
+	case BT_SUBSTJUSTIFY:
+		{
+			pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK);
+			pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+			pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+			SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True );
+			GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_BLOCK, SFX_CALLMODE_RECORD, &aBoolItem, 0L);
+		}
+		break;
+	}
+
+	return 0;
+}
+//==================================for Paragraph Indent=====================
+IMPL_LINK( ParaPropertyPanel, ModifyIndentHdl_Impl, SvxRelativeField*, pBox )
+{
+	SvxLRSpaceItem aMargin( SID_ATTR_LRSPACE );
+	aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) );
+	aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+	aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+	GetBindings()->GetDispatcher()->Execute(
+		SID_ATTR_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+	return 0;
+}
+
+IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl)
+{
+	switch (pControl->GetCurItemId())
+	{
+		case INDENT_INCREMENT:
+		{
+			switch (maContext.GetCombinedContext())
+			{
+				case CombinedEnumContext(Application_Writer, Context_Default):
+				case CombinedEnumContext(Application_Writer, Context_Text):
+				case CombinedEnumContext(Application_Writer, Context_Table):
+				{
+					SfxBoolItem aMargin( SID_INC_INDENT, sal_True );
+					GetBindings()->GetDispatcher()->Execute(
+						SID_INC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+				}
+				break;
+				default:
+				{
+					SvxLRSpaceItem aMargin( SID_ATTR_LRSPACE );
+
+					maTxtLeft += INDENT_STEP;
+					sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+					nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+					aMargin.SetTxtLeft( (const long)nVal );
+					aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+					aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+					GetBindings()->GetDispatcher()->Execute(
+						SID_ATTR_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+				}
+			}
+		}
+		break;
+		case INDENT_DECREMENT:
+		{
+			switch (maContext.GetCombinedContext())
+			{
+				case CombinedEnumContext(Application_Writer, Context_Default):
+				case CombinedEnumContext(Application_Writer, Context_Text):
+				case CombinedEnumContext(Application_Writer, Context_Table):
+				{
+					SfxBoolItem aMargin( SID_DEC_INDENT, sal_True );
+					GetBindings()->GetDispatcher()->Execute(
+						SID_DEC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+				}
+				break;
+				default:
+				{
+					if((maTxtLeft - INDENT_STEP) < 0)
+						maTxtLeft = DEFAULT_VALUE;
+					else
+						maTxtLeft -= INDENT_STEP;
+
+					SvxLRSpaceItem aMargin( SID_ATTR_LRSPACE );
+					
+					sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+					nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+
+					aMargin.SetTxtLeft( (const long)nVal );
+					aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+					aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+					GetBindings()->GetDispatcher()->Execute(
+						SID_ATTR_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+				}
+			}
+		}
+		break;
+		case ID_HANGING_INDENT:
+		{
+			SvxLRSpaceItem aMargin( SID_ATTR_LRSPACE );
+			aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) );
+
+			GetBindings()->GetDispatcher()->Execute(
+				SID_ATTR_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+		}
+		break;
+	}
+	return( 0L );
+}
+
+IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl)
+{
+	switch (pControl->GetCurItemId())
+	{
+		case BT_TBX_INDENT_PROMOTE:
+		{
+			SvxLRSpaceItem aMargin( SID_ATTR_PARA_RIGHT );
+
+			maTxtLeft += INDENT_STEP;
+			sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+			nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+			aMargin.SetTxtLeft( (const long)nVal );
+			aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+			GetBindings()->GetDispatcher()->Execute(
+				SID_ATTR_PARA_RIGHT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+		}
+		break;
+		case BT_TBX_INDENT_DEMOTE:
+		{
+			if((maTxtLeft - INDENT_STEP) < 0)
+				maTxtLeft = DEFAULT_VALUE;
+			else
+				maTxtLeft -= INDENT_STEP;
+
+			SvxLRSpaceItem aMargin( SID_ATTR_PARA_LEFT );
+			
+			sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+			nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+
+			aMargin.SetTxtLeft( (const long)nVal );
+			aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+			GetBindings()->GetDispatcher()->Execute(
+				SID_ATTR_PARA_LEFT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+		}
+		break;
+		case SD_HANGING_INDENT:
+		{
+			SvxLRSpaceItem aMargin( SID_ATTR_LRSPACE );
+			aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+			aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) );
+
+			GetBindings()->GetDispatcher()->Execute(
+				SID_ATTR_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+		}
+		break;
+	}
+	return( 0L );
+}
+//==================================for Paragraph Line Spacing=====================
+
+IMPL_LINK( ParaPropertyPanel, ClickLineSPDropDownHdl_Impl, ToolBox*, pBox )
+{
+	
+	const sal_uInt16 nId = pBox->GetCurItemId();
+	OSL_ASSERT(nId == TOOLBOX_ITEM1);
+	if(nId == TOOLBOX_ITEM1)
+	{
+		pBox->SetItemDown( nId, true );
+		maLineSpacePopup.Rearrange(meLnSpState,m_eMetricUnit,mpLnSPItem,maContext);
+		maLineSpacePopup.Show(*pBox);
+
+	}
+	return (0L);
+}
+
+//==================================for Paragraph Spacing=====================
+IMPL_LINK( ParaPropertyPanel, ULSpaceHdl_Impl, SvxRelativeField*, pBox )
+{
+	SvxULSpaceItem aMargin( SID_ATTR_ULSPACE );
+	aMargin.SetUpper( (sal_uInt16)GetCoreValue( *maTopDist.get(), m_eULSpaceUnit ) );
+	aMargin.SetLower( (sal_uInt16)GetCoreValue( *maBottomDist.get(), m_eULSpaceUnit ) );
+
+	GetBindings()->GetDispatcher()->Execute(
+		SID_ATTR_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+	return 0L;
+}
+
+IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl)
+{
+	switch (pControl->GetCurItemId())
+		{
+	    case UL_INCREMENT:
+		     {
+				 SvxULSpaceItem aMargin( SID_ATTR_ULSPACE );
+
+				 maUpper += UL_STEP;
+				 sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+				 nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+				 aMargin.SetUpper( (const sal_uInt16)nVal );
+
+				 maLower += UL_STEP;
+				 nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+				 nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+	             aMargin.SetLower( (const sal_uInt16)nVal );
+
+				 GetBindings()->GetDispatcher()->Execute(
+					 SID_ATTR_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+			 }
+			 break;
+		case UL_DECREMENT:
+			{
+				 SvxULSpaceItem aMargin( SID_ATTR_ULSPACE );
+
+				 if( maUpper >= UL_STEP )
+				 {
+					maUpper -= UL_STEP;
+					sal_Int64	nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+					nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+					aMargin.SetUpper( (const sal_uInt16)nVal );
+				 }
+				 else
+					aMargin.SetUpper( DEFAULT_VALUE );
+				 if( maLower >= UL_STEP )
+				 {
+					maLower -= UL_STEP;
+					sal_Int64	nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+					nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+					aMargin.SetLower( (const sal_uInt16)nVal );
+				 }
+				 else
+					aMargin.SetLower( DEFAULT_VALUE );
+
+				 GetBindings()->GetDispatcher()->Execute(
+					 SID_ATTR_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+			}
+			break;
+		}
+	return( 0L );
+}
+
+//==================================for Paragraph State change=====================
+void ParaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{	
+	if( nSID == SID_ATTR_METRIC )
+	{
+		m_eMetricUnit = GetCurrentUnit(eState,pState);
+		if( m_eMetricUnit!=m_last_eMetricUnit )
+		{
+			SetFieldUnit( *maLeftIndent.get(), m_eMetricUnit );
+			SetFieldUnit( *maRightIndent.get(), m_eMetricUnit );
+			SetFieldUnit( *maFLineIndent.get(), m_eMetricUnit );
+			SetFieldUnit( *maTopDist.get(), m_eMetricUnit );
+			SetFieldUnit( *maBottomDist.get(), m_eMetricUnit );
+		}
+		m_last_eMetricUnit = m_eMetricUnit;
+	}
+
+	if( nSID == SID_ATTR_PARA_LRSPACE )
+		StateChangedIndentImpl( nSID, eState, pState );		
+
+	if( nSID == SID_ATTR_PARA_LINESPACE )	
+		StateChangedLnSPImpl( nSID, eState, pState );	
+
+	if( nSID == SID_ATTR_PARA_ULSPACE)
+		StateChangedULImpl( nSID, eState, pState );
+
+	if (nSID==SID_ATTR_PARA_ADJUST_LEFT || nSID==SID_ATTR_PARA_ADJUST_CENTER || nSID==SID_ATTR_PARA_ADJUST_RIGHT || nSID==SID_ATTR_PARA_ADJUST_BLOCK)
+		StateChangedAlignmentImpl( nSID, eState, pState );
+
+	if (nSID==SID_OUTLINE_LEFT || nSID==SID_OUTLINE_RIGHT)
+		StateChangeOutLineImpl( nSID, eState, pState );
+
+	if (nSID==SID_INC_INDENT || nSID==SID_DEC_INDENT)
+		StateChangeIncDecImpl( nSID, eState, pState );
+	//Sym3_1093. Add toggle state for numbering and bullet icons
+	if (nSID==FN_NUM_NUMBERING_ON || nSID==FN_NUM_BULLET_ON) 
+		StateChangeBulletNumImpl( nSID, eState, pState );
+
+	//Modified for Numbering&Bullets Dialog UX Enh(Story 992) by chengjh,2011.7.5
+	//Get the num rule index data of the current selection
+	if ( nSID == FN_BUL_NUM_RULE_INDEX ||nSID == FN_NUM_NUM_RULE_INDEX) 
+		StateChangeBulletNumRuleImpl( nSID, eState, pState );
+	//End
+	
+	if ((nSID == SID_TABLE_VERT_NONE)||(nSID == SID_TABLE_VERT_CENTER)||(nSID == SID_TABLE_VERT_BOTTOM))
+	{
+		VertStateChanged( nSID, eState, pState);
+	}
+	else if (nSID == SID_BACKGROUND_COLOR)
+	{
+		ParaBKGStateChanged(nSID, eState, pState);
+	}
+}
+
+void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	if( eState >= SFX_ITEM_AVAILABLE )
+	{
+		const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
+		bool IsChecked = (bool)pItem->GetValue();
+		switch (nSID)
+		{
+		case SID_ATTR_PARA_ADJUST_LEFT:
+			{
+				if(IsChecked)
+				{
+					maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+				}
+				else
+					maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+			}
+			break;
+		case SID_ATTR_PARA_ADJUST_CENTER:
+			{
+				if(IsChecked)
+				{
+					maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+				}
+				else
+					maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+			}
+			break;
+		case SID_ATTR_PARA_ADJUST_RIGHT:
+			{
+				if(IsChecked)
+				{
+					maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+				}
+				else
+					maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+			}
+			break;
+		case SID_ATTR_PARA_ADJUST_BLOCK:
+			{
+				if(IsChecked)
+				{
+					maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+					maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);
+				}
+				else
+					maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+			}
+			break;
+		}
+	}
+	else if( eState == SFX_ITEM_DISABLED )
+	{
+	}
+	else if ( eState == SFX_ITEM_DONTCARE )
+	{
+		switch (nSID)
+		{
+		case SID_ATTR_PARA_ADJUST_LEFT:
+			maAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK);
+			break;
+		case SID_ATTR_PARA_ADJUST_CENTER:
+			maAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK);
+			break;
+		case SID_ATTR_PARA_ADJUST_RIGHT:
+			maAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK);	
+			break;
+		case SID_ATTR_PARA_ADJUST_BLOCK:
+			maAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK);
+			break;
+		}
+	}
+}
+
+void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	switch (maContext.GetCombinedContext())
+	{
+		
+		case CombinedEnumContext(Application_Writer, Context_DrawText):
+		case CombinedEnumContext(Application_Calc, Context_DrawText):
+		case CombinedEnumContext(Application_Writer, Context_Annotation):
+		{
+			maLeftIndent->SetMin( DEFAULT_VALUE );
+			maRightIndent->SetMin( DEFAULT_VALUE );
+			maFLineIndent->SetMin( DEFAULT_VALUE );
+			maTbxIndent_IncDec->Show();
+			maTbxProDemote->Hide();
+		}
+		break;
+		case CombinedEnumContext(Application_Draw, Context_DrawText):
+        	case CombinedEnumContext(Application_Impress, Context_DrawText):
+		case CombinedEnumContext(Application_Draw, Context_Draw):
+		case CombinedEnumContext(Application_Draw, Context_TextObject):
+		case CombinedEnumContext(Application_Draw, Context_Graphic):
+		case CombinedEnumContext(Application_Impress, Context_Draw):
+		case CombinedEnumContext(Application_Impress, Context_TextObject):
+		case CombinedEnumContext(Application_Impress, Context_Graphic):
+		case CombinedEnumContext(Application_Impress, Context_Table):
+        	case CombinedEnumContext(Application_Draw, Context_Table):
+		{
+    		maLeftIndent->SetMin( DEFAULT_VALUE );
+			maRightIndent->SetMin( DEFAULT_VALUE );
+			maFLineIndent->SetMin( DEFAULT_VALUE );
+			maTbxIndent_IncDec->Hide();
+			maTbxProDemote->Show();
+		}
+		break;
+		case CombinedEnumContext(Application_Writer, Context_Default):
+		case CombinedEnumContext(Application_Writer, Context_Text):
+		case CombinedEnumContext(Application_Writer, Context_Table):
+		{
+			maLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+			maRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+			maFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+			maTbxIndent_IncDec->Show();
+			maTbxProDemote->Hide();
+		}
+		break;
+	}
+
+	if( pState && eState >= SFX_ITEM_AVAILABLE )
+	{
+		SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState;
+		maTxtLeft = pSpace->GetTxtLeft();
+		maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+		maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+		long aTxtRight = pSpace->GetRight();
+		aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+		aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+		long aTxtFirstLineOfst = pSpace->GetTxtFirstLineOfst();
+		aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+		aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+		long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+		nVal = (long)maLeftIndent->Normalize( (long)nVal );
+		maLeftIndent->SetValue( nVal, FUNIT_100TH_MM );
+
+		if(maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) && 
+			maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
+			maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table))
+		{
+			maFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM );
+		}
+
+		long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+		nrVal = (long)maRightIndent->Normalize( (long)nrVal );
+	    maRightIndent->SetValue( nrVal, FUNIT_100TH_MM );
+
+		long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+		nfVal = (long)maFLineIndent->Normalize( (long)nfVal );
+		maFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );	
+
+		switch (maContext.GetCombinedContext())
+		{
+			case CombinedEnumContext(Application_Writer, Context_DrawText):
+			case CombinedEnumContext(Application_Writer, Context_Text):
+			case CombinedEnumContext(Application_Writer, Context_Default):
+			case CombinedEnumContext(Application_Writer, Context_Table):
+			case CombinedEnumContext(Application_Writer, Context_Annotation):
+			{
+				maLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM );
+				maRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM );
+				maFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM );
+			}
+			break;
+			case CombinedEnumContext(Application_Draw, Context_DrawText):
+			case CombinedEnumContext(Application_Draw, Context_Draw):
+        		case CombinedEnumContext(Application_Draw, Context_Table):
+			case CombinedEnumContext(Application_Draw, Context_TextObject):
+			case CombinedEnumContext(Application_Draw, Context_Graphic):
+			case CombinedEnumContext(Application_Impress, Context_TextObject):
+        		case CombinedEnumContext(Application_Impress, Context_DrawText):
+			case CombinedEnumContext(Application_Impress, Context_Table):
+			case CombinedEnumContext(Application_Impress, Context_Draw):
+			case CombinedEnumContext(Application_Impress, Context_Graphic):
+			{
+				maLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM );
+				maRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM );
+				maFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM );
+			}
+		}
+
+		maTbxIndent_IncDec->Enable();
+		maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True);
+		if(maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) 
+			&& maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default)
+			&& maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table))
+		{
+			maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True);
+			maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True);
+		}
+
+		maTbxProDemote->Enable();
+		if( !mbOutLineRight && !mbOutLineLeft )
+			maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
+		maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
+	}
+	else if( eState == SFX_ITEM_DISABLED )
+	{
+		maLeftIndent-> Disable();
+		maRightIndent->Disable();
+		maFLineIndent->Disable();
+		maTbxIndent_IncDec->Disable();
+		if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text)  && 
+			maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
+			maContext.GetCombinedContext() !=  CombinedEnumContext(Application_Writer, Context_Table) )
+			maTbxIndent_IncDec->Disable();
+		else
+			maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
+
+		maTbxProDemote->Disable();
+		maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
+	}
+	else
+	{
+		maLeftIndent->SetEmptyFieldValue();
+		maRightIndent->SetEmptyFieldValue();
+		maFLineIndent->SetEmptyFieldValue();
+		if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text)  && 
+			maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
+			maContext.GetCombinedContext() !=  CombinedEnumContext(Application_Writer, Context_Table) )
+			maTbxIndent_IncDec->Disable();
+		else
+			maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
+		maTbxProDemote->Disable();
+		maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
+	}
+}
+
+void ParaPropertyPanel::StateChangedLnSPImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	meLnSpState = eState;
+
+	if( pState && eState >= SFX_ITEM_AVAILABLE )
+	{
+		if(mpLnSPItem)
+			delete mpLnSPItem;
+		mpLnSPItem = ( SvxLineSpacingItem *)pState->Clone();
+	}
+}
+
+void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	maTopDist->SetMax( maTopDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) );
+	maBottomDist->SetMax( maBottomDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) );
+
+	if( pState && eState >= SFX_ITEM_AVAILABLE )
+	{
+		SvxULSpaceItem* pOldItem = (SvxULSpaceItem*)pState;
+
+		maUpper = pOldItem->GetUpper();
+		maUpper = OutputDevice::LogicToLogic( maUpper, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM );
+		maUpper = OutputDevice::LogicToLogic( maUpper, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+		maLower = pOldItem->GetLower();
+		maLower = OutputDevice::LogicToLogic( maLower, (MapUnit)m_eULSpaceUnit, MAP_100TH_MM );
+		maLower = OutputDevice::LogicToLogic( maLower, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+		sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+		nVal = maTopDist->Normalize( nVal );
+		maTopDist->SetValue( nVal, FUNIT_100TH_MM );
+
+		nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+		nVal = maBottomDist->Normalize( nVal );
+		maBottomDist->SetValue( nVal, FUNIT_100TH_MM );
+		maTbxUL_IncDec->Enable();
+	}
+	else if(nSID == SID_ATTR_ULSPACE && eState == SFX_ITEM_DISABLED )
+	{
+		maTopDist->Disable();
+		maBottomDist->Disable();
+		maTbxUL_IncDec->Disable();
+	}
+	else if (nSID == SID_ATTR_ULSPACE)
+	{
+		maTopDist->SetEmptyFieldValue();
+		maBottomDist->SetEmptyFieldValue();
+		maTbxUL_IncDec->Disable();
+	}
+}
+
+void ParaPropertyPanel::StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+    if (nSID==SID_OUTLINE_LEFT)
+	{
+		if( pState && eState == SFX_ITEM_UNKNOWN )
+			mbOutLineLeft = 1;
+		else 
+			mbOutLineLeft = 0;
+	}
+	if (nSID==SID_OUTLINE_RIGHT)
+	{
+		if( pState && eState == SFX_ITEM_UNKNOWN )
+			mbOutLineRight = 1;
+		else 
+			mbOutLineRight = 0;
+	}
+	if(mbOutLineLeft)
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_True);
+	else
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_False);
+
+	if(mbOutLineRight)
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_True);
+	else
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_False);
+
+	if( !mbOutLineRight && !mbOutLineLeft )
+	{
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_PROMOTE, sal_True);
+		maTbxProDemote->EnableItem(BT_TBX_INDENT_DEMOTE, sal_True);
+		maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
+	}
+	else 
+		maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
+}
+
+void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	if (nSID==SID_INC_INDENT)
+	{
+		if( pState && eState == SFX_ITEM_UNKNOWN )
+			maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True);
+		else
+			if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text)  && 
+				maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
+			maContext.GetCombinedContext() !=  CombinedEnumContext(Application_Writer, Context_Table) )
+				maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_False);
+	}
+	if (nSID==SID_DEC_INDENT)
+	{
+		if( pState && eState == SFX_ITEM_UNKNOWN )
+			maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True);
+		else
+			if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text)  &&
+				maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
+			maContext.GetCombinedContext() !=  CombinedEnumContext(Application_Writer, Context_Table) )
+				maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_False);
+	}
+}
+//Sym3_1093. Add toggle state for numbering and bullet icons
+void ParaPropertyPanel::StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	if (nSID==FN_NUM_NUMBERING_ON)
+	{
+		if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)))
+		{
+			const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
+			sal_Bool aBool = (sal_Bool)pItem->GetValue();
+			if (aBool) {
+				maTBxNumBullet->SetItemState(IID_NUMBER,	STATE_CHECK);
+			} else {
+				maTBxNumBullet->SetItemState(IID_NUMBER,	STATE_NOCHECK);
+			}
+		}
+	}
+	if (nSID==FN_NUM_BULLET_ON)
+	{
+		if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)))
+		{
+			const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
+			sal_Bool aBool = (sal_Bool)pItem->GetValue();
+			if (aBool) {
+				maTBxNumBullet->SetItemState(IID_BULLET,	STATE_CHECK);
+			} else {
+				maTBxNumBullet->SetItemState(IID_BULLET,	STATE_NOCHECK);
+			}
+		}
+	}
+}
+//Modified for Numbering&Bullets Dialog UX Enh(Story 992) by chengjh,2011.7.5
+//Handing the transferred the num rule index data of the current selection
+void ParaPropertyPanel::StateChangeBulletNumRuleImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+	
+	const SfxUInt16Item* pIt = (const SfxUInt16Item*)pState;
+	sal_uInt16 nValue = (sal_uInt16)0xFFFF;
+	if ( pIt )
+		nValue = pIt->GetValue();
+
+	if ( nSID == FN_BUL_NUM_RULE_INDEX ) 
+	{
+		nBulletTypeIndex = nValue;
+	}else if ( nSID == FN_NUM_NUM_RULE_INDEX ) 
+	{
+		nNumTypeIndex = nValue;
+	}
+}
+//End
+FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState )
+{
+	FieldUnit eUnit = FUNIT_NONE;
+
+	if ( pState && eState >= SFX_ITEM_DEFAULT )
+		eUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue();
+	else
+	{
+		SfxViewFrame* pFrame = SfxViewFrame::Current();
+		SfxObjectShell* pSh = NULL;
+		if ( pFrame )
+			pSh = pFrame->GetObjectShell();
+		if ( pSh )  //the object shell is not always available during reload
+		{
+			SfxModule* pModule = pSh->GetModule();
+			if ( pModule )
+			{
+				const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
+				if ( pItem )
+					eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+			}
+			else
+			{
+				DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" );
+			}
+		}
+	}
+	
+	return eUnit;
+}
+//new FixedText(this, SVX_RES(FT_COLOR))
+
+PopupControl* ParaPropertyPanel::CreateLineSpacingControl (PopupContainer* pParent)
+{
+	return new ParaLineSpacingControl(pParent, *this);
+}
+
+PopupControl* ParaPropertyPanel::CreateBulletsPopupControl (PopupContainer* pParent)
+{
+	return new ParaBulletsControl(pParent, *this);
+}
+
+PopupControl* ParaPropertyPanel::CreateNumberingPopupControl (PopupContainer* pParent)
+{
+	return new ParaNumberingControl(pParent, *this);
+}
+
+PopupControl* ParaPropertyPanel::CreateBGColorPopupControl (PopupContainer* pParent)
+{
+	return new ColorControl(
+        pParent,
+        mpBindings,
+        SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
+        SVX_RES(VS_FONT_COLOR),
+        ::boost::bind(&ParaPropertyPanel::GetBGColor, this),
+        ::boost::bind(&ParaPropertyPanel::SetBGColor, this, _1,_2),
+        pParent,
+        0);
+}
+
+
+ParaPropertyPanel::ParaPropertyPanel(Window* pParent,
+    const cssu::Reference<css::frame::XFrame>& rxFrame,
+    SfxBindings* pBindings)
+:	Control(pParent, SVX_RES(RID_SIDEBAR_PARA_PANEL))
+//, mnContextId			(PROPERTY_CONTEXT_NOT_SUPPORT)
+//Alignment
+,maAlignToolBoxBackground(ControlFactory::CreateToolBoxBackground(this))
+, maAlignToolBox          (ControlFactory::CreateToolBox(maAlignToolBoxBackground.get(),SVX_RES(TBX_HORIZONTALALIGNMENT)))
+,maTBxVertAlignBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTBxVertAlign	(ControlFactory::CreateToolBox(maTBxVertAlignBackground.get(),SVX_RES(TBX_VERT_ALIGN)))
+, maLeftPara              (SVX_RES(IMG_LEFT_PARA))
+, maCentPara              (SVX_RES(IMG_CENTER_PARA))
+, maRightPara             (SVX_RES(IMG_RIGHT_PARA))
+, maJusPara               (SVX_RES(IMG_JUSTIFY_PARA))
+, maVertImageList		  (SVX_RES(IL_VERT_ALIGN))
+, maVertImageListH		  (SVX_RES(IL_VERT_ALIGN))
+//Num&Backcolor
+,maTBxNumBulletBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTBxNumBullet		  (ControlFactory::CreateToolBox(maTBxNumBulletBackground.get(),SVX_RES(TBX_NUM_BULLET)))
+,maTBxBackColorBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTBxBackColor		  (ControlFactory::CreateToolBox(maTBxBackColorBackground.get(),SVX_RES(TBX_BACK_COLOR)))
+, maNumBImageList		  (SVX_RES(IL_NUM_BULLET))
+, maNumBImageListH		  (SVX_RES(ILH_NUM_BULLET))
+, maNumBImageListRTL	  (SVX_RES(IL_NUM_BULLET_RTL))	//wj sym2_7380
+, maImgBackColorHigh	  (SVX_RES(IMG_BACK_COLOR_H))
+, maImgBackColor		  (SVX_RES(IMG_BACK_COLOR))
+, mpColorUpdater		  ()
+, maColor				  (COL_AUTO)
+, mbColorAvailable		  (sal_True)
+//Paragraph spacing
+, maFTUL                  (new FixedText(this, SVX_RES(FT_SPACING)))
+,maTbxUL_IncDecBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTbxUL_IncDec          (ControlFactory::CreateToolBox(maTbxUL_IncDecBackground.get(),SVX_RES(TBX_UL_INC_DEC)))
+, maParInc                (SVX_RES(IMG_PARA_INC))
+, maParDec                (SVX_RES(IMG_PARA_DEC))
+, maTopDist				  (new SvxRelativeField(this, SVX_RES(MF_ABOVE_PARASPACING)))
+, maBottomDist            (new SvxRelativeField(this, SVX_RES(MF_BELOW_PARASPACING)))
+//Indent
+, maFTIndent              (new FixedText(this, SVX_RES(FT_INDENT)))
+,maTbxIndent_IncDecBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTbxIndent_IncDec      (ControlFactory::CreateToolBox(maTbxIndent_IncDecBackground.get(),SVX_RES(TBX_INDENT_INC_DEC)))
+,maTbxProDemoteBackground(ControlFactory::CreateToolBoxBackground(this))
+, maTbxProDemote          (ControlFactory::CreateToolBox(maTbxProDemoteBackground.get(),SVX_RES(TBX_INDENT_PRO_DEMOTE)))
+, maLeftIndent			  (new SvxRelativeField(this, SVX_RES(MF_BEFORE_INDENT)))
+, maRightIndent			  (new SvxRelativeField(this, SVX_RES(MF_AFTER_INDENT)))
+, maFLineIndent			  (new SvxRelativeField(this, SVX_RES(MF_FL_INDENT)))
+, maIndInc                (SVX_RES(IMG_INDENT_INC))
+, maIndDec                (SVX_RES(IMG_INDENT_DEC))
+, maIndInc_BD             (SVX_RES(IMG_INDENT_INC_BD))
+, maIndDec_BD             (SVX_RES(IMG_INDENT_DEC_BD))
+, maIndHang				  (SVX_RES(IMG_INDENT_HANG))
+, maTxtLeft               (0)
+//Line spacing
+,maLineSPTbxBackground(ControlFactory::CreateToolBoxBackground(this))
+, maLineSPTbx             (ControlFactory::CreateToolBox(maLineSPTbxBackground.get(),SVX_RES(TBX_LINESP)))
+, maSpace1                (SVX_RES(IMG_SPACE1))
+, maSpace2                (SVX_RES(IMG_SPACE2))
+, maSpace3                (SVX_RES(IMG_SPACE3))
+, maIndent1               (SVX_RES(IMG_INDENT1))
+, maIndent2               (SVX_RES(IMG_INDENT2))
+, maIndent3               (SVX_RES(IMG_INDENT3))
+, maLineSpacePopup(this, ::boost::bind(&ParaPropertyPanel::CreateLineSpacingControl, this, _1))
+, maBulletsPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBulletsPopupControl, this, _1))
+, maNumberingPopup(this, ::boost::bind(&ParaPropertyPanel::CreateNumberingPopupControl, this, _1))
+, maBGColorPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBGColorPopupControl, this, _1))
+//Controller
+, maLeftAlignControl      (SID_ATTR_PARA_ADJUST_LEFT, *pBindings,*this)
+, maCenterAlignControl    (SID_ATTR_PARA_ADJUST_CENTER, *pBindings,*this)
+, maRightAlignControl     (SID_ATTR_PARA_ADJUST_RIGHT, *pBindings,*this)
+, maJustifyAlignControl   (SID_ATTR_PARA_ADJUST_BLOCK, *pBindings,*this)
+, maLRSpaceControl        (SID_ATTR_PARA_LRSPACE,*pBindings,*this)
+, maLNSpaceControl        (SID_ATTR_PARA_LINESPACE, *pBindings,*this)
+, maULSpaceControl        (SID_ATTR_PARA_ULSPACE, *pBindings,*this)
+, maOutLineLeftControl    (SID_OUTLINE_LEFT, *pBindings,*this)
+, maOutLineRightControl   (SID_OUTLINE_RIGHT, *pBindings,*this)
+, maIncIndentControl	  (SID_INC_INDENT, *pBindings,*this)
+, maDecIndentControl      (SID_DEC_INDENT, *pBindings,*this)
+, maVertTop				  (SID_TABLE_VERT_NONE, *pBindings,*this)
+, maVertCenter			  (SID_TABLE_VERT_CENTER, *pBindings,*this)
+, maVertBottom			  (SID_TABLE_VERT_BOTTOM,*pBindings,*this)
+, maBulletOnOff			  (FN_NUM_BULLET_ON, *pBindings,*this)
+, maNumberOnOff			  (FN_NUM_NUMBERING_ON, *pBindings,*this)
+//Modified for Numbering&Bullets Dialog UX Enh(Story 992) by chengjh,2011.7.5
+//Add entry to transfer number rule index data
+,maBulletNumRuleIndex		(FN_BUL_NUM_RULE_INDEX, *pBindings,*this)
+,maNumNumRuleIndex		(FN_NUM_NUM_RULE_INDEX, *pBindings,*this)
+//End
+, maBackColorControl      (SID_BACKGROUND_COLOR,	*pBindings,*this)
+, m_aMetricCtl			  (SID_ATTR_METRIC, *pBindings,*this)
+//, m_eMetricUnit			  (FUNIT_INCH)
+//, m_last_eMetricUnit      (FUNIT_INCH)
+//internal var
+, maUpper                       (0)
+, maLower                       (0)
+, mpLnSPItem					(NULL)
+, meLnSpState					(SFX_ITEM_DONTCARE)
+, maFISpace1                    ( this, SVX_RES( FI_SPACE1))
+, maFISpace2                    ( this, SVX_RES( FI_SPACE2))
+, maFIndent1                    ( this, SVX_RES( FI_INDENT1))
+, maFIndent2                    ( this, SVX_RES( FI_INDENT2))
+, maFIndent3                    ( this, SVX_RES( FI_INDENT3))
+, mbOutLineRight				(0)
+, mbOutLineLeft					(0)
+,nBulletTypeIndex ((sal_uInt16)0xFFFF)
+,nNumTypeIndex ((sal_uInt16)0xFFFF)
+//End
+,mpBindings(pBindings)
+{
+	initial();
+	FreeResource();	
+}
+
+}}

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc?rev=1463154&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc (added)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc Mon Apr  1 14:43:34 2013
@@ -0,0 +1,378 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "svx/dialogs.hrc"
+
+#define BT_SUBSTLEFT                                 1     
+#define BT_SUBSTCENTER                               2                  
+#define BT_SUBSTRIGHT                                3    
+#define BT_SUBSTJUSTIFY                              4   
+#define BT_BTX_LINESP                                1
+#define BT_TBX_INDENT_INC                            1
+#define BT_TBX_INDENT_DEC                            2
+#define BT_TBX_UL_INC                                1
+#define BT_TBX_UL_DEC                                2
+#define ID_HANGING_INDENT							 3
+#define BT_TBX_INDENT_PROMOTE					     1
+#define BT_TBX_INDENT_DEMOTE					     2
+#define SD_HANGING_INDENT						     3
+#define MF_BEFORE_INDENT						     2
+#define MF_AFTER_INDENT						         4
+#define MF_FL_INDENT							     6
+#define TBX_HORIZONTALALIGNMENT                      5    
+#define IMG_LEFT_PARA                                7
+#define IMG_CENTER_PARA                              8 
+#define IMG_RIGHT_PARA                               9
+#define IMG_JUSTIFY_PARA                             10
+#define IMG_INDENT_INC                               11
+#define IMG_INDENT_DEC                               12
+#define IMG_PARA_INC                                 13
+#define IMG_PARA_DEC                                 14
+#define IMG_INDENT_HANG								 15
+#define FT_INDENT                                    16 
+#define TBX_INDENT_INC_DEC                           17
+#define FI_SPACE1								     18
+#define FI_SPACE2								     19
+#define FI_INDENT1								     20
+#define FI_INDENT2								     21
+#define FI_INDENT3								     22
+#define IMG_SPACE3							         23
+#define TBX_LINESP                                   25
+#define IMG_SPACE1                                   26
+#define IMG_INDENT1                                  27
+#define IMG_INDENT2                                  28
+#define IMG_SPACE2                                   29
+#define IMG_INDENT3                                  30
+#define FT_SPACING                                   31
+#define TBX_UL_INC_DEC                               33
+#define MF_ABOVE_PARASPACING						 32
+#define MF_BELOW_PARASPACING						 34
+#define TBX_INDENT_PRO_DEMOTE						 35
+#define TBX_VERT_ALIGN		40
+#define IL_VERT_ALIGN		41
+#define	ILH_VERT_ALIGN		42
+#define TBX_NUM_BULLET		44
+#define IL_NUM_BULLET		45
+#define ILH_NUM_BULLET		46
+#define FT_BACK_COLOR		47
+#define TBX_BACK_COLOR		48
+#define TBI_BACK_COLOR		49
+#define IMG_BACK_COLOR		50
+#define	IMG_BACK_COLOR_H	51
+#define IL_NUM_BULLET_RTL		52	//sym2_7380
+#define TBI_VERT_ALIGN_TOP	    60
+#define TBI_VERT_ALIGN_CENTER	61
+#define TBI_VERT_ALIGN_BOT	    62
+#define TBI_NUMBERING	        63
+#define TBI_BULLET	            64
+#define TBI_HOR_ALIGN_LEFT	    65
+#define TBI_HOR_ALIGN_CENTER	66
+#define TBI_HOR_ALIGN_RIGHT	    67
+#define TBI_HOR_ALIGN_JUSTIFY	68
+#define TBI_INDENT_INC		    69
+#define TBI_INDENT_DEC		    70
+#define TBI_UL_INC			    71
+#define TBI_UL_DEC			    72
+#define IMG_INDENT_INC_BD		73
+#define IMG_INDENT_DEC_BD		74
+
+//for vertical alignment
+#define IID_VERT_TOP		1
+#define IID_VERT_CENTER		2
+#define IID_VERT_BOTTOM		3
+
+//for numbering and bullett
+#define IID_BULLET			1
+#define IID_NUMBER			2
+//============================== popup bullet and numbering & back color =========================
+#define VS_VALUES			1
+#define IL_BULLET_BITMAPS	2
+#define CB_BULLET_MORE		4
+#define BMP_BULLET_MORE		5
+#define BMP_BULLET_MORE_H	6
+#define IMG_SEPERATOR_BULLET	7
+
+#define VS_NUMBERING		10
+#define CB_NUMBERING_MORE	12
+#define BMP_NUMERING_MORE	13
+#define BMP_NUMERING_MORE_H	14
+#define IMG_SEPERATOR_NUMBERING	15
+#define VS_FONT_COLOR		1
+#define STR_NOFILL			2
+
+//============================== line space popup page ==============================
+
+#define LB_LINE_SPACING                    1
+#define ED_SBINDE_LINEDISTPERCENT          2
+#define ED_SBINDE_LINEDISTPOINT	           3
+
+#define FT_CUSTOM                          14
+#define FT_LINE_SPACING                    15
+#define FT_OF                              16 
+#define IMG_SPACING1                       18
+#define IMG_SPACING115                     19
+#define IMG_SPACING15                      20
+#define IMG_SPACING2                       21
+#define IMG_SPACINGLCUSTOM                 22
+#define IMG_SEL_SPACING1                   23
+#define IMG_SEL_SPACING115                 24
+#define IMG_SEL_SPACING15                  25
+#define IMG_SEL_SPACING2                   26
+#define IMG_LPCUSTOMNOBORDER               27
+#define FI_CUSTOM_NOBORDER_LSPACE          28
+#define LINE_SPACING					   29
+#define STR_SPACING1					   30
+#define STR_SPACING115                     31
+#define STR_SPACING15                      32
+#define STR_SPACING2                       33
+#define IMG_CUSTOM					       34
+#define IMG_CUSTOM_GRAY				       35
+#define STR_LCVALUE						   36
+#define STR_LS_SINGLE					   37
+#define STR_LS_115					       38
+#define STR_LS_15					       39
+#define STR_LS_DOUBLE					   40
+#define STR_LSPACING					   41
+#define STR_LS_OF					       42
+
+//============================== Help ID ==============================
+#define HID_TBX_HORIZONTALALIGNMENT	"HID_TBX_HORIZONTALALIGNMENT" 
+#define HID_TBI_HOR_ALIGN_LEFT		"HID_TBI_HOR_ALIGN_LEFT" 
+#define HID_TBI_HOR_ALIGN_CENTER	"HID_TBI_HOR_ALIGN_CENTER"
+#define HID_TBI_HOR_ALIGN_RIGHT		"HID_TBI_HOR_ALIGN_RIGHT"
+#define HID_TBI_HOR_ALIGN_JUSTIFY	"HID_TBI_HOR_ALIGN_JUSTIFY"
+
+#define HID_TBX_VERT_ALIGN			"HID_TBX_VERT_ALIGN"
+#define HID_TBI_VERT_ALIGN_TOP		"HID_TBI_VERT_ALIGN_TOP"
+#define HID_TBI_VERT_ALIGN_CENTER	"HID_TBI_VERT_ALIGN_CENTER"
+#define HID_TBI_VERT_ALIGN_BOT		"HID_TBI_VERT_ALIGN_BOT"
+
+#define HID_TBX_INDENT "HID_TBX_INDENT" 
+#define HID_TBI_INDENT "HID_TBI_INDENT"
+//#define HID_TBX_LINESP 705263129 
+//#define HID_TBI_LINESP 705262617
+#define HID_TBX_GRSPACE "HID_TBX_GRSPACE"
+#define HID_TBI_GRSPACE "HID_TBI_GRSPACE"
+#define HID_TBX_BACK_COLOR	"HID_TBX_BACK_COLOR"
+#define HID_TBI_BACK_COLOR	"HID_TBI_BACK_COLOR"
+
+//#define HID_TBX_INDENT_INC_DEC 705263121
+//#define HID_TBI_INDENT_DEC 705262662
+//#define HID_TBI_INDENT_INC 705262661
+//#define HID_TBX_UL_INC_DEC 705263137
+//#define HID_TBI_UL_INC 705262663
+//#define HID_TBI_UL_DEC 705262664
+
+//#define HID_TBX_NUM_BULLET 705263148
+//#define HID_TBI_NUMBERING 705262655
+//#define HID_TBI_BULLET	705262656
+
+#define HID_POPUP_BULLET_CB_BULLET_MORE	"HID_POPUP_BULLET_CB_BULLET_MORE"
+#define HID_POPUP_BULLET_VS_VALUES		"HID_POPUP_BULLET_VS_VALUES"
+#define HID_POPUP_NUM_CB_NUMBERING_MORE "HID_POPUP_NUM_CB_NUMBERING_MORE"
+#define HID_POPUP_NUM_VS_NUMBERING		"HID_POPUP_NUM_VS_NUMBERING"
+
+#define HID_POPUP_INDENT_ED_INDENT_LEFTINDENT	"HID_POPUP_INDENT_ED_INDENT_LEFTINDENT"
+#define HID_POPUP_INDENT_ED_INDENT_RIGHTINDENT	"HID_POPUP_INDENT_ED_INDENT_RIGHTINDENT"
+#define HID_POPUP_INDENT_ED_INDENT_FLINDENT		"HID_POPUP_INDENT_ED_INDENT_FLINDENT"
+#define HID_POPUP_INDENT_TBX_INDENT_NONE	"HID_POPUP_INDENT_TBX_INDENT_NONE"
+#define HID_POPUP_INDENT_TBI_INDENT_NONE	"HID_POPUP_INDENT_TBI_INDENT_NONE"
+#define HID_POPUP_INDENT_TBX_INDENT_BEFORE1	"HID_POPUP_INDENT_TBX_INDENT_BEFORE1"
+#define HID_POPUP_INDENT_TBI_INDENT_BEFORE1	"HID_POPUP_INDENT_TBI_INDENT_BEFORE1"
+#define HID_POPUP_INDENT_TBX_INDENT_BEFORE2 "HID_POPUP_INDENT_TBX_INDENT_BEFORE2"
+#define HID_POPUP_INDENT_TBI_INDENT_BEFORE2 "HID_POPUP_INDENT_TBI_INDENT_BEFORE2"
+#define HID_POPUP_INDENT_TBX_INDENT_FLINE	"HID_POPUP_INDENT_TBX_INDENT_FLINE"
+#define HID_POPUP_INDENT_TBI_INDENT_FLINE	"HID_POPUP_INDENT_TBI_INDENT_FLINE"
+#define HID_POPUP_INDENT_TBX_INDENT_HANGING	"HID_POPUP_INDENT_TBX_INDENT_HANGING"
+#define HID_POPUP_INDENT_TBI_INDENT_HANGING "HID_POPUP_INDENT_TBI_INDENT_HANGING"
+#define HID_POPUP_INDENT_TBX_INDENT_LCUSTOM "HID_POPUP_INDENT_TBX_INDENT_LCUSTOM"
+#define HID_POPUP_INDENT_TBI_INDENT_LCUSTOM "HID_POPUP_INDENT_TBI_INDENT_LCUSTOM"
+
+#define HID_POPUP_LS_LB_LINE_SPACING			"HID_POPUP_LS_LB_LINE_SPACING"
+#define HID_POPUP_LS_ED_SBINDE_LINEDISTPERCENT	"HID_POPUP_LS_ED_SBINDE_LINEDISTPERCENT"
+#define HID_POPUP_LS_ED_SBINDE_LINEDISTPOINT	 "HID_POPUP_LS_ED_SBINDE_LINEDISTPOINT"
+#define HID_POPUP_LS_TBX_LINESP_1				"HID_POPUP_LS_TBX_LINESP_1"
+#define HID_POPUP_LS_TBI_LINESP_1				"HID_POPUP_LS_TBI_LINESP_1"
+#define HID_POPUP_LS_TBX_LINESP_15				"HID_POPUP_LS_TBX_LINESP_15"
+#define HID_POPUP_LS_TBI_LINESP_15				"HID_POPUP_LS_TBI_LINESP_15"
+#define HID_POPUP_LS_TBX_LINESP_2				"HID_POPUP_LS_TBX_LINESP_2"
+#define HID_POPUP_LS_TBI_LINESP_2				"HID_POPUP_LS_TBI_LINESP_2"
+#define HID_POPUP_LS_TBX_LINESP_115				"HID_POPUP_LS_TBX_LINESP_115"
+#define HID_POPUP_LS_TBI_LINESP_115				"HID_POPUP_LS_TBI_LINESP_115"
+#define HID_POPUP_LS_TBX_LINESP_LCUSTOM			"HID_POPUP_LS_TBX_LINESP_LCUSTOM"
+#define HID_POPUP_LS_TBI_LINESP_LCUSTOM			"HID_POPUP_LS_TBI_LINESP_LCUSTOM"
+
+#define HID_POPUP_PS_ED_SBINDE_TOPDIST		"HID_POPUP_PS_ED_SBINDE_TOPDIST"
+#define HID_POPUP_PS_ED_SBINDE_BOTTOMDIST	"HID_POPUP_PS_ED_SBINDE_BOTTOMDIST"
+#define HID_POPUP_PS_TBX_NORMAL				"HID_POPUP_PS_TBX_NORMAL"
+#define HID_POPUP_PS_TBI_NORMAL				"HID_POPUP_PS_TBI_NORMAL"
+#define HID_POPUP_PS_TBX_NARROW				"HID_POPUP_PS_TBX_NARROW"
+#define HID_POPUP_PS_TBI_NARROW				"HID_POPUP_PS_TBI_NARROW"
+#define HID_POPUP_PS_TBX_WIDE				"HID_POPUP_PS_TBX_WIDE"
+#define HID_POPUP_PS_TBI_WIDE				"HID_POPUP_PS_TBI_WIDE"
+#define HID_POPUP_PS_TBX_LASTCUSTOM			"HID_POPUP_PS_TBX_LASTCUSTOM"
+#define HID_POPUP_PS_TBI_LASTCUSTOM			"HID_POPUP_PS_TBI_LASTCUSTOM"
+
+//============================== Property ==============================
+#define _FIXED_TEXT_HEIGHT          9
+#define _FIXED_TEXT_WIDTH           40
+#define CONTROL_HEIGHT		        15
+#define CONTROL_WIDTH		        45
+#define ALIGNMENT_TBX_HEIGHT        17
+#define ALIGNMENT_TBX_WIDTH         13
+#define LISTBOX_HEIGHT              80
+#define IMAGE_SIZE                  16
+#define POPUP_TOOLBOX_SIZE          32
+#define TOOLBOX_HEIGHT              22
+#define TOOLBOX_WIDTH               23
+#define TEXT_SPACING_VERTICAL       2
+#define BUTTON_SPACING              18
+//#define TOOLBOX_ITEM_HEIGHT			17
+#define VS_SPACING_WIDTH		    78
+
+//==============================Section page position==============================
+
+#define TBX_HORI_ALIGN_X	SECTIONPAGE_MARGIN_HORIZONTAL + TBX_OUT_BORDER_OFFSET_X/2
+#define TBX_HORI_ALIGN_Y	SECTIONPAGE_MARGIN_VERTICAL_TOP
+
+#define TBX_VERT_ALIGN_X	TBX_HORI_ALIGN_X + TBX_OUT_BORDER_OFFSET_X*2 + TOOLBOX_ITEM_WIDTH * 4 + CONTROL_SPACING_HORIZONTAL
+#define TBX_VERT_ALIGN_Y	TBX_HORI_ALIGN_Y
+
+#define TBX_NUM_BULLET_X	TBX_HORI_ALIGN_X
+#define TBX_NUM_BULLET_Y	TBX_HORI_ALIGN_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 1
+
+#define TBX_BACK_COLOR_X	TBX_HORI_ALIGN_X + TBX_OUT_BORDER_OFFSET_X*2 + TOOLBOX_ITEM_WIDTH * 3 + CONTROL_SPACING_HORIZONTAL
+#define TBX_BACK_COLOR_Y	TBX_NUM_BULLET_Y
+
+#define FT_PARA_SPACE_X		SECTIONPAGE_MARGIN_HORIZONTAL
+#define FT_PARA_SPACE_Y		TBX_NUM_BULLET_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 3
+#define FT_PARA_SPACE_Y2	TBX_HORI_ALIGN_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 2
+
+#define TBX_PARA_SPACE_INC_DEC_X	TBX_HORI_ALIGN_X
+#define TBX_PARA_SPACE_INC_DEC_Y	FT_PARA_SPACE_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define TBX_PARA_SPACE_INC_DEC_Y2	FT_PARA_SPACE_Y2 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+
+#define FT_PARA_INDENT_X	TBX_VERT_ALIGN_X
+#define FT_PARA_INDENT_Y	FT_PARA_SPACE_Y
+#define FT_PARA_INDENT_Y2	FT_PARA_SPACE_Y2
+
+#define TBX_PARA_INDENT_INC_DEC_X	TBX_VERT_ALIGN_X
+#define TBX_PARA_INDENT_INC_DEC_Y	TBX_PARA_SPACE_INC_DEC_Y
+#define TBX_PARA_INDENT_INC_DEC_Y2	TBX_PARA_SPACE_INC_DEC_Y2
+
+#define MBX_TOP_DIST_X		FT_PARA_SPACE_X + TOOLBOX_ITEM_WIDTH
+#define MBX_TOP_DIST_Y		TBX_PARA_SPACE_INC_DEC_Y + TOOLBOX_ITEM_WIDTH + CONTROL_SPACING_VERTICAL + 4*TBX_OUT_BORDER_OFFSET_Y - 1
+#define MBX_TOP_DIST_Y2		TBX_PARA_SPACE_INC_DEC_Y2 + TOOLBOX_ITEM_WIDTH + CONTROL_SPACING_VERTICAL + 4*TBX_OUT_BORDER_OFFSET_Y - 1
+#define MBX_BOT_DIST_X		MBX_TOP_DIST_X
+#define MBX_BOT_DIST_Y		MBX_TOP_DIST_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+#define MBX_BOT_DIST_Y2		MBX_TOP_DIST_Y2 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+
+#define IMG_SPACE_X		    FT_PARA_SPACE_X - 3
+#define IMG_SPACE1_Y		MBX_TOP_DIST_Y  - 1
+#define IMG_SPACE2_Y		MBX_BOT_DIST_Y  - 1
+#define IMG_SPACE1_Y2		MBX_TOP_DIST_Y2  - 1
+#define IMG_SPACE2_Y2		MBX_BOT_DIST_Y2  - 1
+
+#define MBX_LEFT_DIST_X		FT_PARA_INDENT_X + TOOLBOX_ITEM_WIDTH
+#define MBX_LEFT_DIST_Y		MBX_TOP_DIST_Y
+#define MBX_LEFT_DIST_Y2	MBX_TOP_DIST_Y2
+#define MBX_RIGHT_DIST_X	MBX_LEFT_DIST_X
+#define MBX_RIGHT_DIST_Y	MBX_BOT_DIST_Y
+#define MBX_RIGHT_DIST_Y2	MBX_BOT_DIST_Y2
+#define MBX_FLINE_DIST_X	MBX_LEFT_DIST_X
+#define MBX_FLINE_DIST_Y	MBX_RIGHT_DIST_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+#define MBX_FLINE_DIST_Y2	MBX_RIGHT_DIST_Y2 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
+
+#define IMG_INDENT_X		FT_PARA_INDENT_X - 4
+#define IMG_INDENT1_Y		MBX_LEFT_DIST_Y - 1
+#define IMG_INDENT2_Y		MBX_RIGHT_DIST_Y - 1
+#define IMG_INDENT3_Y		MBX_FLINE_DIST_Y - 1
+#define IMG_INDENT1_Y2		MBX_LEFT_DIST_Y2 - 1
+#define IMG_INDENT2_Y2		MBX_RIGHT_DIST_Y2- 1
+#define IMG_INDENT3_Y2		MBX_FLINE_DIST_Y2- 1
+
+#define TBX_LINE_SPACE_X	TBX_HORI_ALIGN_X
+#define TBX_LINE_SPACE_Y	MBX_FLINE_DIST_Y
+#define TBX_LINE_SPACE_Y2	MBX_FLINE_DIST_Y2
+
+#define PARA_SECTIONPAGE_HEIGHT		MBX_FLINE_DIST_Y + TOOLBOX_ITEM_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
+#define PARA_SECTIONPAGE_HEIGHT_2	MBX_FLINE_DIST_Y2 + TOOLBOX_ITEM_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
+
+#define LINE_X_WHITE		FT_PARA_INDENT_X - 5
+#define LINE_TOP_Y			FT_PARA_INDENT_Y + 1
+#define LINE_TOP_Y2			FT_PARA_INDENT_Y2 + 1
+#define LINE_BOT_Y			TBX_LINE_SPACE_Y + TOOLBOX_ITEM_HEIGHT - 1
+#define LINE_BOT_Y2			TBX_LINE_SPACE_Y2 + TOOLBOX_ITEM_HEIGHT - 1
+
+//==============================numbering and bullet==============================
+#define NB_MARGIN_VERTICAL		POPUPPANEL_MARGIN_VERTICAL
+#define NB_MARGIN_HORIZONTAL	POPUPPANEL_MARGIN_HORIZONTAL
+#define SPACING_VERTICAL_S3		    8
+//#define SPACING_VERTICAL_S1		12
+#define POPUPPANEL_MARGIN_NB   4
+
+#define NB_IMAGE_WIDTH		25
+#define NB_IMAGE_HEIGHT		25
+#define NB_IMAGE_SPACING	5
+
+#define BULLET_IMAGE_WIDTH		NB_IMAGE_WIDTH
+#define BULLET_IMAGE_HEIGHT		NB_IMAGE_HEIGHT
+#define BULLET_IMAGE_SPACING	NB_IMAGE_SPACING
+
+#define NUM_IMAGE_WIDTH		25
+#define NUM_IMAGE_HEIGHT	35
+#define NUM_IMAGE_SPACING	NB_IMAGE_SPACING
+
+#define FIXED_TEXT_HEIGHT        13
+#define FIXED_TEXT_WIDTH         80
+#define CUST_MORE_BUTTON_HEIGHT	 15
+
+#define VS_WIDTH_BULLET		BULLET_IMAGE_WIDTH*3+BULLET_IMAGE_SPACING*2
+#define VS_HEIGHT_BULLET	BULLET_IMAGE_HEIGHT*4+BULLET_IMAGE_SPACING*3
+#define VS_WIDTH_NUM		NUM_IMAGE_WIDTH*3+NB_IMAGE_SPACING*2
+#define VS_HEIGHT_NUM		NUM_IMAGE_HEIGHT*3+NB_IMAGE_SPACING*2
+
+#define POPUP_WIDTH_BULLET	VS_WIDTH_BULLET + POPUPPANEL_MARGIN_NB * 2
+#define POPUP_HEIGHT_BULLET	VS_HEIGHT_BULLET + POPUPPANEL_MARGIN_NB * 3 + CUST_MORE_BUTTON_HEIGHT
+#define POPUP_WIDTH_NUM		VS_WIDTH_NUM + POPUPPANEL_MARGIN_NB * 2
+#define POPUP_HEIGHT_NUM	VS_HEIGHT_NUM + POPUPPANEL_MARGIN_NB * 3 + CUST_MORE_BUTTON_HEIGHT
+
+#define CUST_MORE_BUTTON_X	1
+#define CUST_MORE_BUTTON_IMG_OFF_X		2	//NB_MARGIN_HORIZONTAL - CUST_MORE_BUTTON_X + OFFSET_X
+
+//==============================Line Spacing popup page=======================
+
+#define POPUP_PAGE_HEIGHT    POP_BORDER_Y + BD_HEIGHT + POPUPPANEL_MARGIN_NB + OFFSET_Y
+#define POP_FT_CUSTOM_X      POPUPPANEL_MARGIN_NB + OFFSET_X
+#define POP_FT_CUSTOM_Y      POPUPPANEL_MARGIN_SMALL * 2 + 17 * 5
+#define POP_BORDER_X         POPUPPANEL_MARGIN_NB + OFFSET_X + 1
+#define POP_BORDER_Y         POPUPPANEL_MARGIN_SMALL * 3 + 17 * 5 + TEXT_HEIGHT
+#define BD_WIDTH             VS_SPACING_WIDTH - 6
+#define BD_HEIGHT            TEXT_HEIGHT*2 + CONTROL_HEIGHT*2 + CONTROL_SPACING_VERTICAL*3 + TEXT_CONTROL_SPACING_VERTICAL*2 - 4
+
+#define FT_1_X               POP_BORDER_X + POPUPPANEL_MARGIN_LARGE
+#define FT_1_Y               POP_BORDER_Y + CONTROL_SPACING_VERTICAL
+#define EDIT_1_X             FT_1_X
+#define EDIT_1_Y             FT_1_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
+#define FT_2_X               FT_1_X
+#define FT_2_Y               EDIT_1_Y + CONTROL_HEIGHT + CONTROL_SPACING_VERTICAL - 3
+#define EDIT_2_X             FT_1_X
+#define EDIT_2_Y             FT_2_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
\ No newline at end of file

Propchange: openoffice/branches/sidebar/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message