summaryrefslogtreecommitdiff
path: root/sw/source/ui/shells
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/shells')
-rw-r--r--sw/source/ui/shells/annotsh.cxx103
-rw-r--r--sw/source/ui/shells/basesh.cxx10
-rw-r--r--sw/source/ui/shells/beziersh.cxx6
-rw-r--r--sw/source/ui/shells/drawdlg.cxx27
-rw-r--r--sw/source/ui/shells/drawsh.cxx13
-rw-r--r--sw/source/ui/shells/drformsh.cxx5
-rw-r--r--sw/source/ui/shells/drwbassh.cxx24
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx77
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx74
-rw-r--r--sw/source/ui/shells/frmsh.cxx90
-rw-r--r--sw/source/ui/shells/grfsh.cxx14
-rw-r--r--sw/source/ui/shells/mediash.cxx2
-rw-r--r--sw/source/ui/shells/olesh.cxx4
-rw-r--r--sw/source/ui/shells/slotadd.cxx5
-rw-r--r--sw/source/ui/shells/tabsh.cxx27
-rw-r--r--sw/source/ui/shells/textsh.cxx4
-rw-r--r--sw/source/ui/shells/textsh1.cxx81
-rw-r--r--sw/source/ui/shells/txtattr.cxx14
-rw-r--r--sw/source/ui/shells/txtnum.cxx209
19 files changed, 722 insertions, 67 deletions
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index d9c8a247bd70..ba175337caa8 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -40,6 +40,8 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <editeng/spltitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
#include <editeng/orphitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/widwitem.hxx>
@@ -105,6 +107,7 @@
#include <svx/dialogs.hrc>
#include <svx/svxids.hrc>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svl/itempool.hxx>
#include <editeng/outliner.hxx>
#include <editeng/editeng.hxx>
@@ -151,6 +154,7 @@ SwAnnotationShell::SwAnnotationShell( SwView& r )
{
SwWrtShell &rSh = rView.GetWrtShell();
SetPool(rSh.GetAttrPool().GetSecondaryPool());
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Annotation));
}
SwAnnotationShell::~SwAnnotationShell()
@@ -186,6 +190,35 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
sal_uInt16 nEEWhich = 0;
switch (nSlot)
{
+ case SID_ATTR_PARA_LRSPACE:
+ {
+ SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)rReq.
+ GetArgs()->Get(nSlot));
+ aParaMargin.SetWhich( EE_PARA_LRSPACE );
+
+ aNewAttr.Put(aParaMargin);
+ rReq.Done();
+ break;
+ }
+ case SID_ATTR_PARA_LINESPACE:
+ {
+ SvxLineSpacingItem aParaMargin = (const SvxLineSpacingItem&)pNewAttrs->Get(
+ GetPool().GetWhich(nSlot));
+ aParaMargin.SetWhich( EE_PARA_SBL );
+
+ aNewAttr.Put(aParaMargin);
+ rReq.Done();
+ break;
+ }
+ case SID_ATTR_PARA_ULSPACE:
+ {
+ SvxULSpaceItem aULSpace = (const SvxULSpaceItem&)pNewAttrs->Get(
+ GetPool().GetWhich(nSlot));
+ aULSpace.SetWhich( EE_PARA_ULSPACE );
+ aNewAttr.Put( aULSpace );
+ rReq.Done();
+ }
+ break;
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT:
case SID_ATTR_CHAR_WEIGHT:
@@ -203,8 +236,19 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
case SID_ATTR_CHAR_UNDERLINE:
{
- FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
- aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
+ if( rReq.GetArgs() )
+ {
+ SFX_REQUEST_ARG( rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
+ if (pItem)
+ {
+ aNewAttr.Put(*pItem);
+ }
+ else
+ {
+ FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
+ aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE ) );
+ }
+ }
break;
}
case SID_ATTR_CHAR_OVERLINE:
@@ -426,6 +470,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
delete pDialog;
}
break;
+ case SID_CHAR_DLG_EFFECT:
case SID_CHAR_DLG:
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -450,6 +495,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True );
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
+ if (nSlot == SID_CHAR_DLG_EFFECT)
+ {
+ pDlg->SetCurPageId(TP_CHAR_EXT);
+ }
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet )
{
@@ -592,6 +641,44 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
switch( nSlotId )
{
+ case SID_ATTR_PARA_LRSPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState( EE_PARA_LRSPACE );
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxLRSpaceItem aLR = ( (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE ) );
+ aLR.SetWhich(SID_ATTR_PARA_LRSPACE);
+ rSet.Put(aLR);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ }
+ break;
+ case SID_ATTR_PARA_LINESPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState( EE_PARA_SBL );
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxLineSpacingItem aLR = ( (const SvxLineSpacingItem&) aEditAttr.Get( EE_PARA_SBL ) );
+ rSet.Put(aLR);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ }
+ break;
+ case SID_ATTR_PARA_ULSPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState( EE_PARA_ULSPACE );
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxULSpaceItem aULSpace = (const SvxULSpaceItem&) aEditAttr.Get( EE_PARA_ULSPACE );
+ aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
+ rSet.Put(aULSpace);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ }
+ break;
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT:
case SID_ATTR_CHAR_WEIGHT:
@@ -622,6 +709,8 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW;break;
case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT;break;
case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
+ case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT;break;
+ case SID_ATTR_CHAR_KERNING: nEEWhich = EE_CHAR_KERNING;break;
case FN_SET_SUPER_SCRIPT:
case FN_SET_SUB_SCRIPT:
{
@@ -763,7 +852,17 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
}
if(nEEWhich)
+ {
rSet.Put(aEditAttr.Get(nEEWhich, sal_True), nWhich);
+ if(nEEWhich == EE_CHAR_KERNING)
+ {
+ SfxItemState eState = aEditAttr.GetItemState( EE_CHAR_KERNING, sal_True );
+ if ( eState == SFX_ITEM_DONTCARE )
+ {
+ rSet.InvalidateItem(EE_CHAR_KERNING);
+ }
+ }
+ }
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
rSet.DisableItem( nWhich );
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 713b22370ae8..8911882c124c 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2452,8 +2452,9 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
switch ( nSlot )
{
- case FN_FORMAT_PAGE_COLUMN_DLG:
case FN_FORMAT_PAGE_DLG:
+ case FN_FORMAT_PAGE_COLUMN_DLG:
+ case FN_FORMAT_PAGE_SETTING_DLG:
{
if( !bBackground )
{
@@ -2462,9 +2463,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
//temp. View, weil die Shell nach dem Dialog nicht mehr gueltig sein muss
//z.B. Kopfzeile ausschalten
SwView& rTempView = GetView();
- rTempView.GetDocShell()->FormatPage(rPageDesc.GetName(),
- nSlot == FN_FORMAT_PAGE_COLUMN_DLG,
- &rSh );
+ rTempView.GetDocShell()->FormatPage(
+ rPageDesc.GetName(),
+ nSlot,
+ rSh );
rTempView.InvalidateRulerPos();
}
}
diff --git a/sw/source/ui/shells/beziersh.cxx b/sw/source/ui/shells/beziersh.cxx
index b4f639232a3b..332e5e51ece7 100644
--- a/sw/source/ui/shells/beziersh.cxx
+++ b/sw/source/ui/shells/beziersh.cxx
@@ -31,6 +31,7 @@
#include <svl/eitem.hxx>
#include <svl/whiter.hxx>
#include <svx/svdopath.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx>
@@ -73,6 +74,8 @@ SwBezierShell::SwBezierShell(SwView &_rView):
SwWrtShell *pSh = &GetShell();
SdrView* pSdrView = pSh->GetDrawView();
pSdrView->SetEliminatePolyPointLimitAngle(1500L);
+
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Draw));
}
/*--------------------------------------------------------------------
@@ -347,6 +350,3 @@ void SwBezierShell::GetState(SfxItemSet &rSet)
nWhich = aIter.NextWhich();
}
}
-
-
-
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index fa190755b778..26cd85732705 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -108,7 +108,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
DBG_ASSERT(pDlg, "Dialogdiet fail!");
const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
- if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+ if(pColorItem->GetColorTable() == XColorList::GetStdColorList())
pDlg->DontDeleteColorTable();
if (pDlg->Execute() == RET_OK)
{
@@ -121,12 +121,18 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
static sal_uInt16 __READONLY_DATA aInval[] =
{
- SID_ATTR_FILL_STYLE, SID_ATTR_FILL_COLOR, 0
+ SID_ATTR_FILL_STYLE,
+ SID_ATTR_FILL_COLOR,
+ SID_ATTR_FILL_TRANSPARENCE,
+ SID_ATTR_FILL_FLOATTRANSPARENCE,
+ 0
};
SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
rBnd.Invalidate(aInval);
rBnd.Update(SID_ATTR_FILL_STYLE);
rBnd.Update(SID_ATTR_FILL_COLOR);
+ rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
+ rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
}
delete pDlg;
}
@@ -160,8 +166,16 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
static sal_uInt16 __READONLY_DATA aInval[] =
{
- SID_ATTR_LINE_STYLE, SID_ATTR_LINE_WIDTH,
- SID_ATTR_LINE_COLOR, 0
+ SID_ATTR_LINE_STYLE, // ( SID_SVX_START + 169 )
+ SID_ATTR_LINE_DASH, // ( SID_SVX_START + 170 )
+ SID_ATTR_LINE_WIDTH, // ( SID_SVX_START + 171 )
+ SID_ATTR_LINE_COLOR, // ( SID_SVX_START + 172 )
+ SID_ATTR_LINE_START, // ( SID_SVX_START + 173 )
+ SID_ATTR_LINE_END, // ( SID_SVX_START + 174 )
+ SID_ATTR_LINE_TRANSPARENCE, // (SID_SVX_START+1107)
+ SID_ATTR_LINE_JOINT, // (SID_SVX_START+1110)
+ SID_ATTR_LINE_CAP, // (SID_SVX_START+1111)
+ 0
};
GetView().GetViewFrame()->GetBindings().Invalidate(aInval);
@@ -214,12 +228,17 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest& rReq)
case SID_ATTR_FILL_GRADIENT:
case SID_ATTR_FILL_HATCH:
case SID_ATTR_FILL_BITMAP:
+ case SID_ATTR_FILL_TRANSPARENCE:
+ case SID_ATTR_FILL_FLOATTRANSPARENCE:
pDis->Execute(SID_ATTRIBUTES_AREA, sal_False);
break;
case SID_ATTR_LINE_STYLE:
case SID_ATTR_LINE_DASH:
case SID_ATTR_LINE_WIDTH:
case SID_ATTR_LINE_COLOR:
+ case SID_ATTR_LINE_TRANSPARENCE:
+ case SID_ATTR_LINE_JOINT:
+ case SID_ATTR_LINE_CAP:
pDis->Execute(SID_ATTRIBUTES_LINE, sal_False);
break;
}
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 3ab5d2270009..f027bf7e531e 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <svx/xtable.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svx/svdoashp.hxx>
#include "swundo.hxx"
@@ -169,9 +170,11 @@ void SwDrawShell::Execute(SfxRequest &rReq)
break;
case FN_FLIP_HORZ_GRAFIC:
+ case SID_FLIP_HORIZONTAL:
bMirror = sal_False;
/* no break */
case FN_FLIP_VERT_GRAFIC:
+ case SID_FLIP_VERTICAL:
rSh.MirrorSelection( bMirror );
break;
@@ -346,11 +349,13 @@ void SwDrawShell::GetState(SfxItemSet& rSet)
break;
case FN_FLIP_HORZ_GRAFIC:
+ case SID_FLIP_HORIZONTAL:
if ( !pSdrView->IsMirrorAllowed() || bProtected )
rSet.DisableItem( nWhich );
break;
case FN_FLIP_VERT_GRAFIC:
+ case SID_FLIP_VERTICAL:
if ( !pSdrView->IsMirrorAllowed() || bProtected )
rSet.DisableItem( nWhich );
break;
@@ -384,6 +389,8 @@ SwDrawShell::SwDrawShell(SwView &_rView) :
{
SetHelpId(SW_DRAWSHELL);
SetName(String::CreateFromAscii("Draw"));
+
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Draw));
}
/*************************************************************************
@@ -472,12 +479,8 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(XColorList::GetStdColorList());
pDrView->GetAttributes( rSet );
}
}
-
-
-
-
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx
index 5e73121bf3be..80b6ac857678 100644
--- a/sw/source/ui/shells/drformsh.cxx
+++ b/sw/source/ui/shells/drformsh.cxx
@@ -35,6 +35,7 @@
#include <sfx2/app.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svl/srchitem.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
@@ -262,11 +263,9 @@ SwDrawFormShell::SwDrawFormShell(SwView &_rView) :
SetHelpId(SW_DRAWFORMSHELL);
GetShell().NoEdit(sal_True);
SetName(String::CreateFromAscii("DrawForm"));
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Form));
}
SwDrawFormShell::~SwDrawFormShell()
{
}
-
-
-
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index c3cd2c3de007..ead51e7d7b59 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -382,6 +382,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
}
}
+ else
+ {
+ pSdrView->SetGeoAttrToMarked( *pArgs );
+ }
}
}
break;
@@ -770,9 +774,19 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet)
}
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
+
+void SwDrawBaseShell::GetDrawAttrStateForIFBX( SfxItemSet& rSet )
+{
+ SwWrtShell *pSh = &GetShell();
+ SdrView* pSdrView = pSh->GetDrawView();
+ const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+ if( rMarkList.GetMark(0) != 0 )
+ {
+ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();//OST_IFBX@WL2
+ SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked());
+ rSet.Put(aNewAttr,false);
+ }
+}
sal_Bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
@@ -990,7 +1004,3 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation
pValidation->nHeight = pValidation->nMaxHeight;
return 0;
}
-
-
-
-
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index b4a713f72e3e..c6795a7f2376 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -34,6 +34,8 @@
#include <tools/shl.hxx>
#include <svx/svdview.hxx>
#include <editeng/spltitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
#include <editeng/orphitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/widwitem.hxx>
@@ -236,6 +238,33 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case SID_ATTR_PARA_ADJUST_BLOCK:
aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST));
break;
+ case SID_ATTR_PARA_LRSPACE:
+ {
+ SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)rReq.
+ GetArgs()->Get(nSlot));
+ aParaMargin.SetWhich( EE_PARA_LRSPACE );
+ aNewAttr.Put(aParaMargin);
+ rReq.Done();
+ }
+ break;
+ case SID_ATTR_PARA_LINESPACE:
+ {
+ SvxLineSpacingItem aLineSpace = (const SvxLineSpacingItem&)pNewAttrs->Get(
+ GetPool().GetWhich(nSlot));
+ aLineSpace.SetWhich( EE_PARA_SBL );
+ aNewAttr.Put( aLineSpace );
+ rReq.Done();
+ }
+ break;
+ case SID_ATTR_PARA_ULSPACE:
+ {
+ SvxULSpaceItem aULSpace = (const SvxULSpaceItem&)pNewAttrs->Get(
+ GetPool().GetWhich(nSlot));
+ aULSpace.SetWhich( EE_PARA_ULSPACE );
+ aNewAttr.Put( aULSpace );
+ rReq.Done();
+ }
+ break;
case SID_ATTR_PARA_LINESPACE_10:
{
@@ -286,6 +315,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
break;
+ case SID_CHAR_DLG_EFFECT:
case SID_CHAR_DLG:
case SID_CHAR_DLG_FOR_PARAGRAPH:
{
@@ -317,6 +347,10 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR,0, sal_True );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ if (nSlot == SID_CHAR_DLG_EFFECT)
+ {
+ pDlg->SetCurPageId(TP_CHAR_EXT);
+ }
sal_uInt16 nRet = pDlg->Execute();
if(RET_OK == nRet )
{
@@ -635,6 +669,49 @@ ASK_ADJUST:
}
break;
+ case SID_ATTR_PARA_LRSPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState(EE_PARA_LRSPACE);
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxLRSpaceItem aLR = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE );
+ aLR.SetWhich(SID_ATTR_PARA_LRSPACE);
+ rSet.Put(aLR);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ nSlotId = 0;
+ }
+ break;
+ case SID_ATTR_PARA_LINESPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState(EE_PARA_SBL);
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxLineSpacingItem aLR = (const SvxLineSpacingItem&) aEditAttr.Get( EE_PARA_SBL );
+ rSet.Put(aLR);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ nSlotId = 0;
+ }
+ break;
+ case SID_ATTR_PARA_ULSPACE:
+ {
+ SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE);
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxULSpaceItem aULSpace = (const SvxULSpaceItem&) aEditAttr.Get( EE_PARA_ULSPACE );
+ aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
+ rSet.Put(aULSpace);
+ }
+ else
+ rSet.InvalidateItem(nSlotId);
+ Invalidate(SID_ATTR_PARA_ULSPACE);
+ nSlotId = 0;
+ }
+ break;
+
case SID_ATTR_PARA_LINESPACE_10: nLSpace = 100; goto ASK_LINESPACE;
case SID_ATTR_PARA_LINESPACE_15: nLSpace = 150; goto ASK_LINESPACE;
case SID_ATTR_PARA_LINESPACE_20: nLSpace = 200; goto ASK_LINESPACE;
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index d32e87825f02..0295fd63b35a 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -42,6 +42,7 @@
#include <sfx2/bindings.hxx>
#include <svx/fontwork.hxx>
#include <sfx2/request.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svl/whiter.hxx>
#include <editeng/outliner.hxx>
#include <editeng/editstat.hxx>
@@ -155,6 +156,7 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) :
rSh.NoEdit(sal_True);
SetName(String::CreateFromAscii("ObjectText"));
SetHelpId(SW_DRWTXTSHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_DrawText));
}
/*--------------------------------------------------------------------
@@ -358,7 +360,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(XColorList::GetStdColorList());
pDrView->GetAttributes( rSet );
}
@@ -572,6 +574,28 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
}
}
break;
+ case SID_TABLE_VERT_NONE:
+ case SID_TABLE_VERT_CENTER:
+ case SID_TABLE_VERT_BOTTOM:
+ {
+ sal_uInt16 nSId = rReq.GetSlot();
+ if (pSdrView->AreObjectsMarked())
+ {
+ SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP;
+ if (nSId == SID_TABLE_VERT_CENTER)
+ eTVA = SDRTEXTVERTADJUST_CENTER;
+ else if (nSId == SID_TABLE_VERT_BOTTOM)
+ eTVA = SDRTEXTVERTADJUST_BOTTOM;
+
+ SfxItemSet aNewAttr( pSdrView->GetModel()->GetItemPool() );
+ pSdrView->GetAttributes( aNewAttr );
+ aNewAttr.Put(SdrTextVertAdjustItem(eTVA));
+ pSdrView->SetAttributes(aNewAttr);
+ rReq.Done();
+ }
+
+ }
+ break;
default:
ASSERT(!this, "unexpected slot-id");
@@ -893,5 +917,53 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
return &pOutliner->GetUndoManager();
}
+void SwDrawTextShell::GetStatePropPanelAttr(SfxItemSet &rSet)
+{
+ SfxWhichIter aIter( rSet );
+ sal_uInt16 nWhich = aIter.FirstWhich();
+
+ SwWrtShell &rSh = GetShell();
+ pSdrView = rSh.GetDrawView();
+ SfxItemSet aAttrs( pSdrView->GetModel()->GetItemPool() );
+ pSdrView->GetAttributes( aAttrs );
+ while ( nWhich )
+ {
+ sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
+ ? GetPool().GetSlotId(nWhich)
+ : nWhich;
+ switch ( nSlotId )
+ {
+ case SID_TABLE_VERT_NONE:
+ case SID_TABLE_VERT_CENTER:
+ case SID_TABLE_VERT_BOTTOM:
+ sal_Bool bContour = sal_False;
+ SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME );
+ if( eConState != SFX_ITEM_DONTCARE )
+ {
+ bContour = ( ( const SdrTextContourFrameItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
+ }
+ if (bContour) break;
+
+ SfxItemState eVState = aAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
+ //SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
+
+ //if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState)
+ if(SFX_ITEM_DONTCARE != eVState)
+ {
+ SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
+ sal_Bool bSet = nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP||
+ nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER ||
+ nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM;
+ rSet.Put(SfxBoolItem(nSlotId, bSet));
+ }
+ else
+ {
+ rSet.Put(SfxBoolItem(nSlotId, sal_False));
+ }
+ break;
+ }
+ nWhich = aIter.NextWhich();
+ }
+}
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 83e1be9ce32e..c09610c60950 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -35,6 +35,8 @@
#include <svl/rectitem.hxx>
#include <svl/ptitem.hxx>
#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/bolnitem.hxx>
#include <editeng/boxitem.hxx>
@@ -42,6 +44,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <sfx2/objface.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svx/hlnkitem.hxx>
// --> OD 2009-07-07 #i73249#
#include <svx/svdview.hxx>
@@ -382,7 +385,38 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
}
break;
+
+ case SID_ATTR_TRANSFORM:
+ {
+ bool bApplyNewSize = false;
+
+ Size aNewSize = aMgr.GetSize();
+ if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_WIDTH, sal_False, &pItem ) )
+ {
+ aNewSize.setWidth( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
+ bApplyNewSize = true;
+ }
+
+ if ( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_TRANSFORM_HEIGHT, sal_False, &pItem ) )
+ {
+ aNewSize.setHeight( static_cast< const SfxUInt32Item* >(pItem)->GetValue() );
+ bApplyNewSize = true;
+ }
+
+ if ( bApplyNewSize )
+ {
+ aMgr.SetSize( aNewSize );
+ }
+ else
+ {
+ bUpdateMgr = sal_False;
+ }
+
+ }
+ break;
+
case FN_FORMAT_FRAME_DLG:
+ case FN_PROPERTY_WRAP_DLG:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF)
@@ -416,10 +450,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if( nSel & nsSelectionType::SEL_OLE )
{
- // --> OD 2009-07-13 #i73249#
-// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText()));
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
- // <--
}
const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE);
@@ -468,6 +499,11 @@ void SwFrameShell::Execute(SfxRequest &rReq)
nDefPage);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ if ( nSlot == FN_PROPERTY_WRAP_DLG )
+ {
+ pDlg->SetCurPageId(TP_FRM_WRAP);
+ }
+
if ( pDlg->Execute() )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
@@ -638,16 +674,17 @@ void SwFrameShell::Execute(SfxRequest &rReq)
ASSERT( !this, "falscher Dispatcher" );
return;
}
- // Vorlagen-AutoUpdate
- SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
if ( bUpdateMgr )
{
- if(bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt())
+ SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
+ if ( bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt() )
{
rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
}
else
+ {
aMgr.UpdateFlyFrm();
+ }
}
}
@@ -862,6 +899,40 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
if ( bParentCntProt )
rSet.DisableItem( nWhich );
break;
+
+ case SID_ATTR_TRANSFORM:
+ {
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
+ case SID_ATTR_TRANSFORM_PROTECT_SIZE:
+ {
+ const sal_uInt8 eProtection = rSh.IsSelObjProtected( FLYPROTECT_SIZE );
+ if ( ( eProtection & FLYPROTECT_CONTENT ) ||
+ ( eProtection & FLYPROTECT_SIZE ) )
+ {
+ rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_True ) );
+ }
+ else
+ {
+ rSet.Put( SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, sal_False ) );
+ }
+ }
+ break;
+
+ case SID_ATTR_TRANSFORM_WIDTH:
+ {
+ rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, aMgr.GetSize().getWidth() ) );
+ }
+ break;
+
+ case SID_ATTR_TRANSFORM_HEIGHT:
+ {
+ rSet.Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, aMgr.GetSize().getHeight() ) );
+ }
+ break;
+
case FN_FORMAT_FRAME_DLG:
{
const int nSel = rSh.GetSelectionType();
@@ -869,7 +940,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
}
break;
- // --> OD 2009-07-07 #i73249#
+
case FN_TITLE_DESCRIPTION_SHAPE:
{
SwWrtShell &rWrtSh = GetShell();
@@ -882,7 +953,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
}
break;
- // <--
+
default:
/* do nothing */;
break;
@@ -906,6 +977,8 @@ SwFrameShell::SwFrameShell(SwView &_rView) :
/* #96392# Use this to announce it is the frame shell who creates the
selection. */
SwTransferable::CreateSelection( _rView.GetWrtShell(), (ViewShell *) this );
+
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Frame));
}
SwFrameShell::~SwFrameShell()
@@ -1148,4 +1221,3 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet)
if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE))
rSet.DisableItem(FN_INSERT_FRAME);
}
-
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 7c869c6f3024..c60f32b80955 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -43,6 +43,7 @@
#include <editeng/sizeitem.hxx>
#include <editeng/protitem.hxx>
#include <sfx2/request.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svl/srchitem.hxx>
#include <svx/htmlmode.hxx>
#include <svx/sdgluitm.hxx>
@@ -113,6 +114,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
break;
case SID_INSERT_GRAPHIC:
case FN_FORMAT_GRAFIC_DLG:
+ case FN_PROPERTY_WRAP_DLG:
{
SwFlyFrmAttrMgr aMgr( sal_False, &rSh, rSh.IsFrmSelected() ?
FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF);
@@ -149,10 +151,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if ( nSlot == FN_FORMAT_GRAFIC_DLG )
{
- // --> OD 2009-07-13 #i73249#
-// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText()));
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
- // <--
}
pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT);
@@ -230,6 +229,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
GetView().GetWindow(),
aSet, sal_False, DLG_FRM_GRF);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
+
+ if (nSlot == FN_PROPERTY_WRAP_DLG)
+ pDlg->SetCurPageId(TP_FRM_WRAP);
+
if( pDlg->Execute() )
{
rSh.StartAllAction();
@@ -381,12 +384,14 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
{
case FN_FLIP_VERT_GRAFIC:
case FN_FLIP_HORZ_GRAFIC:
+ case SID_FLIP_VERTICAL:
+ case SID_FLIP_HORIZONTAL:
{
GetShell().GetCurAttr( aGrfSet );
SwMirrorGrf aMirror( (SwMirrorGrf&)aGrfSet.Get(
RES_GRFATR_MIRRORGRF ) );
sal_uInt16 nMirror = aMirror.GetValue();
- if( FN_FLIP_VERT_GRAFIC == nSlot )
+ if( FN_FLIP_VERT_GRAFIC == nSlot || nSlot==SID_FLIP_VERTICAL )
switch( nMirror )
{
case RES_MIRROR_GRAPH_DONT: nMirror = RES_MIRROR_GRAPH_VERT;
@@ -692,4 +697,5 @@ SwGrfShell::SwGrfShell(SwView &_rView) :
{
SetName(String::CreateFromAscii("Graphic"));
SetHelpId(SW_GRFSHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Graphic));
}
diff --git a/sw/source/ui/shells/mediash.cxx b/sw/source/ui/shells/mediash.cxx
index 17077e860a03..232896389d4a 100644
--- a/sw/source/ui/shells/mediash.cxx
+++ b/sw/source/ui/shells/mediash.cxx
@@ -75,6 +75,7 @@
#endif
#include <sfx2/objface.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <svx/svdomedia.hxx>
#include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx>
#include <avmedia/mediaitem.hxx>
@@ -215,4 +216,5 @@ SwMediaShell::SwMediaShell(SwView &_rView) :
{
SetName(String::CreateFromAscii("Media Playback"));
SetHelpId(SW_MEDIASHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Media));
}
diff --git a/sw/source/ui/shells/olesh.cxx b/sw/source/ui/shells/olesh.cxx
index 142e4bc60b25..6f8f860b2a4b 100644
--- a/sw/source/ui/shells/olesh.cxx
+++ b/sw/source/ui/shells/olesh.cxx
@@ -29,6 +29,7 @@
#include <sfx2/request.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/objitem.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
#ifndef _HELPID_H
@@ -71,6 +72,5 @@ SwOleShell::SwOleShell(SwView &_rView) :
{
SetName(String::CreateFromAscii("Object"));
SetHelpId(SW_OLESHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OLE));
}
-
-
diff --git a/sw/source/ui/shells/slotadd.cxx b/sw/source/ui/shells/slotadd.cxx
index cea3e1f471b2..85f440fe186f 100644
--- a/sw/source/ui/shells/slotadd.cxx
+++ b/sw/source/ui/shells/slotadd.cxx
@@ -137,6 +137,11 @@
#define SvxDrawBezierItem SfxAllEnumItem
#define avmedia_MediaItem ::avmedia::MediaItem
+#include <svx/xflftrit.hxx>
+#include <svx/xlncapit.hxx>
+#include <svx/xlinjoit.hxx>
+#include <svx/AffineMatrixItem.hxx>
+
#define SFX_TYPEMAP
#include <sfx2/msg.hxx>
#include "swslots.hxx"
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index ce02f9ae4079..1d6b4ae1e57c 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -54,6 +54,7 @@
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <fmtornt.hxx>
@@ -1178,16 +1179,17 @@ void SwTableShell::Execute(SfxRequest &rReq)
aMgr.ColWidthDlg(GetView().GetWindow());
}
break;
- case FN_TABLE_VERT_NONE:
- case FN_TABLE_VERT_CENTER:
- case FN_TABLE_VERT_BOTTOM:
+ case SID_TABLE_VERT_NONE:
+ case SID_TABLE_VERT_CENTER:
+ case SID_TABLE_VERT_BOTTOM:
{
- sal_uInt16 nAlign = nSlot == FN_TABLE_VERT_NONE ?
+ sal_uInt16 nAlign = nSlot == SID_TABLE_VERT_NONE ?
text::VertOrientation::NONE :
- nSlot == FN_TABLE_VERT_CENTER ?
+ nSlot == SID_TABLE_VERT_CENTER ?
text::VertOrientation::CENTER : text::VertOrientation::BOTTOM;
rSh.SetBoxAlign(nAlign);
bCallDone = sal_True;
+
}
break;
@@ -1321,14 +1323,15 @@ void SwTableShell::GetState(SfxItemSet &rSet)
case RES_UL_SPACE:
rSet.Put(pFmt->GetULSpace());
break;
- case FN_TABLE_VERT_NONE:
- case FN_TABLE_VERT_CENTER:
- case FN_TABLE_VERT_BOTTOM:
+
+ case SID_TABLE_VERT_NONE:
+ case SID_TABLE_VERT_CENTER:
+ case SID_TABLE_VERT_BOTTOM:
{
sal_uInt16 nAlign = rSh.GetBoxAlign();
- sal_Bool bSet = (nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE) ||
- (nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER) ||
- (nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM);
+ sal_Bool bSet = nSlot == SID_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE||
+ nSlot == SID_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER ||
+ nSlot == SID_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM;
rSet.Put(SfxBoolItem(nSlot, bSet));
}
break;
@@ -1433,6 +1436,7 @@ SwTableShell::SwTableShell(SwView &_rView) :
{
SetName(String::CreateFromAscii("Table"));
SetHelpId(SW_TABSHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Table));
}
/*--------------------------------------------------------------------
@@ -1591,4 +1595,3 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
}
}
-
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index ae6cb9a0cdaa..da07d2e2d14a 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -108,6 +108,7 @@
#define TextFont
#define DropCap
#include <sfx2/msg.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
#include <swslots.hxx>
#include <SwRewriter.hxx>
#include <comcore.hrc>
@@ -1027,6 +1028,7 @@ SwTextShell::SwTextShell(SwView &_rView) :
{
SetName(String::CreateFromAscii("Text"));
SetHelpId(SW_TEXTSHELL);
+ SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Text));
}
/*--------------------------------------------------------------------
@@ -1214,5 +1216,3 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
}
}
}
-
-
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 485e999e6e5a..1601c3cd3b22 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -126,7 +126,19 @@
#include <sfx2/objface.hxx>
#include <langhelper.hxx>
+#ifndef _NBDTMGFACT_HXX
+#include <svx/nbdtmgfact.hxx>
+#endif
+#ifndef _NBDTMG_HXX
+#include <svx/nbdtmg.hxx>
+#endif
+
+
+#include <numrule.hxx>
+
+
using namespace ::com::sun::star;
+using namespace svx::sidebar;
void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq )
@@ -185,6 +197,10 @@ void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,c
if( FN_INSERT_HYPERLINK == nSlot )
pDlg->SetCurPageId(TP_CHAR_URL);
}
+ if (nSlot == SID_CHAR_DLG_EFFECT)
+ {
+ pDlg->SetCurPageId(TP_CHAR_EXT);
+ }
const SfxItemSet* pSet = NULL;
if ( !bUseDialog )
@@ -838,6 +854,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// intentionally no break
}
case SID_CHAR_DLG:
+ case SID_CHAR_DLG_EFFECT:
{
lcl_CharDialog( rWrtSh, bUseDialog, nSlot, pArgs, &rReq );
}
@@ -862,6 +879,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_NUMBER_NEWSTART_AT :
case FN_FORMAT_DROPCAPS :
case FN_DROP_TEXT:
+ case SID_ATTR_PARA_LRSPACE:
{
sal_uInt16 nWhich = GetPool().GetWhich( nSlot );
if ( pArgs && pArgs->GetItemState( nWhich ) == SFX_ITEM_SET )
@@ -952,7 +970,15 @@ void SwTextShell::Execute(SfxRequest &rReq)
SfxItemSet* pSet = NULL;
if ( !bUseDialog )
{
- pSet = (SfxItemSet*) pArgs;
+ if ( nSlot == SID_ATTR_PARA_LRSPACE)
+ {
+ SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)pArgs->Get(nSlot));
+ aParaMargin.SetWhich( RES_LR_SPACE);
+ aCoreSet.Put(aParaMargin);
+ pSet = &aCoreSet;
+
+ } else
+ pSet = (SfxItemSet*) pArgs;
}
else if ( NULL != pDlg && pDlg->Execute() == RET_OK )
@@ -1023,14 +1049,14 @@ void SwTextShell::Execute(SfxRequest &rReq)
//SetNumRuleStart(sal_True) restarts the numbering at the value
//that is defined at the starting point of the numbering level
//otherwise the SetNodeNumStart() value determines the start
- //if it's set to something different than USHRT_MAX
+ //if it's set to something different than (sal_uInt16)0xFFFF
sal_Bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue();
// --> OD 2007-06-11 #b6560525#
- // Default value for restart value has to be USHRT_MAX
+ // Default value for restart value has to be (sal_uInt16)0xFFFF
// in order to indicate that the restart value of the list
// style has to be used on restart.
- sal_uInt16 nNumStart = USHRT_MAX;
+ sal_uInt16 nNumStart = (sal_uInt16)0xFFFF;
// <--
if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) )
{
@@ -1677,6 +1703,51 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.DisableItem(nWhich);
}
break;
+ case FN_NUM_NUMBERING_ON:
+ rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON,rSh.SelectionHasNumber()));
+ break;
+ case FN_NUM_BULLET_ON:
+ rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON,rSh.SelectionHasBullet()));
+ break;
+ case FN_BUL_NUM_RULE_INDEX:
+ case FN_NUM_NUM_RULE_INDEX:
+ {
+ SwNumRule* pCurRule = (SwNumRule*)(GetShell().GetCurNumRule());
+ sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
+ rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE));
+ rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE));
+ if( pCurRule )
+ {
+ nActNumLvl = GetShell().GetNumLevel();
+ if( nActNumLvl < MAXLEVEL )
+ {
+ nActNumLvl = 1<<nActNumLvl;
+ }
+ SvxNumRule aSvxRule = pCurRule->MakeSvxNumRule();
+ if ( GetShell().HasBullet())
+ {
+ rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
+ rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
+ NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS);
+ if ( pBullets )
+ {
+ sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
+ rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,nBulIndex));
+ }
+ }else if ( GetShell().HasNumber() )
+ {
+ rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
+ rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
+ NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING);
+ if ( pNumbering )
+ {
+ sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
+ rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex));
+ }
+ }
+ }
+ }
+ break;
case FN_NUM_CONTINUE:
{
// --> OD 2009-08-26 #i86492#
@@ -1775,7 +1846,7 @@ void SwTextShell::ChangeHeaderOrFooter(
if( !bCrsrSet && bOn )
bCrsrSet = rSh.SetCrsrInHdFt(
- !rStyleName.Len() ? USHRT_MAX : nFrom,
+ !rStyleName.Len() ? (sal_uInt16)0xFFFF : nFrom,
bHeader );
}
}
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 217a2b8f3e64..181e0dafc2a9 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -40,6 +40,7 @@
#include <editeng/fhgtitem.hxx>
#include <editeng/adjitem.hxx>
#include <editeng/lspcitem.hxx>
+#include <editeng/lrspitem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/escpitem.hxx>
#include <svx/htmlmode.hxx>
@@ -745,6 +746,19 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
rSet.Put(SvxAdjustItem((SvxAdjust)eAdjust, SID_ATTR_PARA_ADJUST ));
nSlot = 0;
break;
+ case SID_ATTR_PARA_LRSPACE:
+ {
+ eState = aCoreSet.GetItemState(RES_LR_SPACE);
+ if( eState >= SFX_ITEM_DEFAULT )
+ {
+ SvxLRSpaceItem aLR = ( (const SvxLRSpaceItem&) aCoreSet.Get( RES_LR_SPACE ) );
+ aLR.SetWhich(SID_ATTR_PARA_LRSPACE);
+ rSet.Put(aLR);
+ }
+ else
+ rSet.InvalidateItem(nSlot);
+ nSlot = 0;
+ }
case SID_ATTR_PARA_LEFT_TO_RIGHT :
case SID_ATTR_PARA_RIGHT_TO_LEFT :
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index 13a44cac34a7..0b53d940e5a9 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -46,6 +46,11 @@
#include "swabstdlg.hxx"
#include <globals.hrc>
#include <sfx2/tabdlg.hxx>
+#include <svx/nbdtmg.hxx>
+#include <svx/nbdtmgfact.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
+using namespace svx::sidebar;
void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
@@ -54,14 +59,15 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
case FN_NUM_NUMBERING_ON:
{
+ GetShell().StartAllAction();
SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 , sal_False );
- sal_Bool bMode = !GetShell().HasNumber(); // #i29560#
+ sal_Bool bMode = !GetShell().SelectionHasNumber(); // #i29560#
if ( pItem )
bMode = pItem->GetValue();
else
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bMode ) );
- if ( bMode != (GetShell().HasNumber()) ) // #i29560#
+ if ( bMode != (GetShell().SelectionHasNumber()) ) // #i29560#
{
rReq.Done();
if( bMode )
@@ -69,18 +75,28 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
else
GetShell().NumOrBulletOff(); // #i29560#
}
+ sal_Bool bNewResult = GetShell().SelectionHasNumber();
+ if (bNewResult!=bMode) {
+ SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings();
+ SfxBoolItem aItem(FN_NUM_NUMBERING_ON,!bNewResult);
+ rBindings.SetState(aItem);
+ SfxBoolItem aNewItem(FN_NUM_NUMBERING_ON,bNewResult);
+ rBindings.SetState(aNewItem);
+ }
+ GetShell().EndAllAction();
}
break;
case FN_NUM_BULLET_ON:
{
+ GetShell().StartAllAction();
SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, FN_PARAM_1 , sal_False );
- sal_Bool bMode = !GetShell().HasBullet(); // #i29560#
+ sal_Bool bMode = !GetShell().SelectionHasBullet(); // #i29560#
if ( pItem )
bMode = pItem->GetValue();
else
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bMode ) );
- if ( bMode != (GetShell().HasBullet()) ) // #i29560#
+ if ( bMode != (GetShell().SelectionHasBullet()) ) // #i29560#
{
rReq.Done();
if( bMode )
@@ -88,9 +104,19 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
else
GetShell().NumOrBulletOff(); // #i29560#
}
+ sal_Bool bNewResult = GetShell().SelectionHasBullet();
+ if (bNewResult!=bMode) {
+ SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings();
+ SfxBoolItem aItem(FN_NUM_BULLET_ON,!bNewResult);
+ rBindings.SetState(aItem);
+ SfxBoolItem aNewItem(FN_NUM_BULLET_ON,bNewResult);
+ rBindings.SetState(aNewItem);
+ }
+ GetShell().EndAllAction();
}
break;
case FN_NUMBER_BULLETS:
+ case SID_OUTLINE_BULLET:
{
// --> OD 2008-02-29 #refactorlists#
// // per default sal_True, damit die Schleife im Dialog richtig arbeitet!
@@ -244,4 +270,179 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
}
}
+void SwTextShell::ExecSetNumber(SfxRequest &rReq)
+{
+ SwNumRule aRule( GetShell().GetUniqueNumRuleName(),
+ // --> OD 2008-06-06 #i89178#
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ // <--
+
+ SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
+ const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 );
+
+ if( bRightToLeft )
+ {
+ for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
+ {
+ SvxNumberFormat aFmt( aSvxRule.GetLevel( n ) );
+ /* if ( n && bHtml )
+ {
+ // 1/2" fuer HTML
+ aFmt.SetLSpace(720);
+ aFmt.SetAbsLSpace(n * 720);
+ }*/
+ // --> FME 2005-01-21 #i38904# Default alignment for
+ // numbering/bullet should be rtl in rtl paragraph:
+ if ( bRightToLeft )
+ {
+ aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
+ }
+ // <--
+ aSvxRule.SetLevel( n, aFmt, sal_False );
+ }
+ aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
+ }
+
+ const SwNumRule* pCurRule = GetShell().GetCurNumRule();
+ sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
+ if( pCurRule )
+ {
+ sal_uInt16 nLevel = GetShell().GetNumLevel();
+ if( nLevel < MAXLEVEL )
+ {
+ nActNumLvl = 1<<nLevel;
+ }
+
+ aSvxRule = pCurRule->MakeSvxNumRule();
+ //convert type of linked bitmaps from SVX_NUM_BITMAP to (SVX_NUM_BITMAP|LINK_TOKEN)
+ for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
+ {
+ SvxNumberFormat aFmt(aSvxRule.GetLevel(i));
+ if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
+ {
+ const SvxBrushItem* pBrush = aFmt.GetBrush();
+ const String* pLinkStr;
+ if(pBrush &&
+ 0 != (pLinkStr = pBrush->GetGraphicLink()) &&
+ pLinkStr->Len())
+ aFmt.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN));
+ aSvxRule.SetLevel(i, aFmt, aSvxRule.Get(i) != 0);
+ }
+ }
+ }
+
+
+ switch(rReq.GetSlot())
+ {
+ case FN_SVX_SET_NUMBER:
+ {
+ SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, FN_SVX_SET_NUMBER , sal_False );
+ if (pItem)
+ {
+ sal_uInt16 nIdx = pItem->GetValue();
+ if (nIdx==DEFAULT_NONE) {
+ GetShell().DelNumRules();
+ break;
+ }
+ --nIdx;
+
+ NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING);
+ if ( pNumbering )
+ {
+ SwNumRule aTmpRule( GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+
+ SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
+ //Sym3_2508, set unit attribute to NB Manager
+ SfxItemSet aSet(GetPool(),
+ SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
+ 0 );
+ aSet.Put(SvxNumBulletItem(aTempRule));
+ pNumbering->SetItems(&aSet);
+ pNumbering->ApplyNumRule(aTempRule,nIdx,nActNumLvl);
+
+ sal_uInt16 nMask = 1;
+ for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
+ {
+ if(nActNumLvl & nMask)
+ {
+ SvxNumberFormat aFmt(aTempRule.GetLevel(i));
+ aSvxRule.SetLevel(i, aFmt);
+ }
+ nMask <<= 1 ;
+ }
+
+ aSvxRule.UnLinkGraphics();
+ SwNumRule aSetRule( pCurRule
+ ? pCurRule->GetName()
+ : GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ aSetRule.SetSvxRule( aSvxRule, GetShell().GetDoc());
+
+ aSetRule.SetAutoRule( sal_True );
+ const bool bCreateList = (pCurRule == 0);
+ GetShell().SetCurNumRule( aSetRule, bCreateList );
+ }
+ //End
+ }
+ break;
+ }
+ case FN_SVX_SET_BULLET:
+ {
+ SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, FN_SVX_SET_BULLET , sal_False );
+ if (pItem)
+ {
+ sal_uInt16 nIdx = pItem->GetValue();
+ if (nIdx==DEFAULT_NONE) {
+ GetShell().DelNumRules();
+ break;
+ }
+ nIdx--;
+
+ NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS);
+ if ( pBullets )
+ {
+ SwNumRule aTmpRule( GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+
+ SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
+ //Sym3_2508, set unit attribute to NB Manager
+ SfxItemSet aSet(GetPool(),
+ SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
+ 0 );
+ aSet.Put(SvxNumBulletItem(aTempRule));
+ pBullets->SetItems(&aSet);
+
+ //SvxNumRule aTempRule( 0, 10, false );
+ pBullets->ApplyNumRule(aTempRule,nIdx,nActNumLvl);
+ sal_uInt16 nMask = 1;
+ for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
+ {
+ if(nActNumLvl & nMask)
+ {
+ SvxNumberFormat aFmt(aTempRule.GetLevel(i));
+ aSvxRule.SetLevel(i, aFmt);
+ }
+ nMask <<= 1;
+ }
+ aSvxRule.UnLinkGraphics();
+
+ SwNumRule aSetRule( pCurRule
+ ? pCurRule->GetName()
+ : GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+
+ aSetRule.SetSvxRule( aSvxRule, GetShell().GetDoc());
+
+ aSetRule.SetAutoRule( sal_True );
+ const bool bCreateList = (pCurRule == 0);
+ GetShell().SetCurNumRule( aSetRule, bCreateList );
+ }
+ //End
+ }
+
+ }
+ break;
+ }
+}