diff options
Diffstat (limited to 'sw/source/ui/shells/basesh.cxx')
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 1dba8a3be6..c41790204c 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -99,9 +99,7 @@ #include <tblafmt.hxx> #include <caption.hxx> #include <swwait.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif #ifndef _GLOBALS_HRC #include <globals.hrc> #endif @@ -1062,14 +1060,14 @@ void SwBaseShell::Execute(SfxRequest &rReq) case FN_TOOL_ANKER_FRAME: { RndStdIds eSet = nSlot == FN_TOOL_ANKER_PAGE - ? FLY_PAGE + ? FLY_AT_PAGE : nSlot == FN_TOOL_ANKER_PARAGRAPH - ? FLY_AT_CNTNT + ? FLY_AT_PARA : nSlot == FN_TOOL_ANKER_FRAME ? FLY_AT_FLY : nSlot == FN_TOOL_ANKER_CHAR - ? FLY_IN_CNTNT - : FLY_AUTO_CNTNT; + ? FLY_AS_CHAR + : FLY_AT_CHAR; rSh.StartUndo(); if( rSh.IsObjSelected() ) rSh.ChgAnchor( eSet ); @@ -1100,7 +1098,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) switch( eSet ) { case FLY_AT_FLY: - case FLY_PAGE: + case FLY_AT_PAGE: //Durchlauf, links oder von links, oben, von oben if(eSurround != SURROUND_THROUGHT) @@ -1113,7 +1111,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: //links, von links, rechts, oben, kein Uml, li+re Umlauf, if(eSurround != SURROUND_LEFT || eSurround != SURROUND_RIGHT) aSet.Put(SwFmtSurround(SURROUND_LEFT)); @@ -1125,7 +1123,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: //links, von links, rechts, oben, Durchlauf if(eSurround != SURROUND_THROUGHT) aSet.Put(SwFmtSurround(SURROUND_THROUGHT)); @@ -1623,12 +1621,17 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) else rSh.GetFlyFrmAttr(aSet); RndStdIds eSet = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); - BOOL bSet; - bSet = (nWhich == FN_TOOL_ANKER_PAGE && eSet == FLY_PAGE) || - (nWhich == FN_TOOL_ANKER_PARAGRAPH && eSet == FLY_AT_CNTNT) || - (nWhich == FN_TOOL_ANKER_FRAME && eSet == FLY_AT_FLY) || - (nWhich == FN_TOOL_ANKER_AT_CHAR && eSet == FLY_AUTO_CNTNT) || - (nWhich == FN_TOOL_ANKER_CHAR && eSet == FLY_IN_CNTNT); + const BOOL bSet = + ((nWhich == FN_TOOL_ANKER_PAGE) && + (eSet == FLY_AT_PAGE)) + || ((nWhich == FN_TOOL_ANKER_PARAGRAPH) && + (eSet == FLY_AT_PARA)) + || ((nWhich == FN_TOOL_ANKER_FRAME) && + (eSet == FLY_AT_FLY)) + || ((nWhich == FN_TOOL_ANKER_AT_CHAR) && + (eSet == FLY_AT_CHAR)) + || ((nWhich == FN_TOOL_ANKER_CHAR) && + (eSet == FLY_AS_CHAR)); if(nWhich != FN_TOOL_ANKER) { USHORT nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); @@ -1645,16 +1648,16 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) switch (eSet) { - case FLY_PAGE: + case FLY_AT_PAGE: nSlotId = FN_TOOL_ANKER_PAGE; break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: nSlotId = FN_TOOL_ANKER_PARAGRAPH; break; - case FLY_IN_CNTNT: + case FLY_AS_CHAR: nSlotId = FN_TOOL_ANKER_CHAR; break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: nSlotId = FN_TOOL_ANKER_AT_CHAR; break; case FLY_AT_FLY: @@ -1704,15 +1707,18 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) SwSurround nSurround = rWrap.GetSurround(); BOOL bSet = FALSE; - BOOL bDisable = nAnchorType == - 1 || nAnchorType == FLY_IN_CNTNT; - BOOL bHtmlMode = 0 != ::GetHtmlMode(GetView().GetDocShell()); + bool bDisable = + (nAnchorType == - 1) || (nAnchorType == FLY_AS_CHAR); + const bool bHtmlMode = + 0 != ::GetHtmlMode(GetView().GetDocShell()); switch( nWhich ) { case FN_FRAME_NOWRAP: bDisable |= - ( nAnchorType != FLY_AT_CNTNT && - nAnchorType != FLY_AUTO_CNTNT && nAnchorType != FLY_PAGE); + ( (nAnchorType != FLY_AT_PARA) + && (nAnchorType != FLY_AT_CHAR) + && (nAnchorType != FLY_AT_PAGE)); bSet = nSurround == SURROUND_NONE; break; case FN_FRAME_WRAP: @@ -1725,7 +1731,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_FRAME_WRAPTHRU: bDisable |= (bHtmlMode || - (nAnchorType != FLY_AT_CNTNT&& nAnchorType != FLY_AUTO_CNTNT && nAnchorType != FLY_PAGE)); + ( (nAnchorType != FLY_AT_PARA) + && (nAnchorType != FLY_AT_CHAR) + && (nAnchorType != FLY_AT_PAGE))); if(bObj) bSet = nSurround == SURROUND_THROUGHT && rSh.GetLayerId(); else @@ -1765,7 +1773,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_WRAP_ANCHOR_ONLY: bDisable |= (bHtmlMode || - (nAnchorType != FLY_AT_CNTNT)); + (nAnchorType != FLY_AT_PARA)); bSet = rWrap.IsAnchorOnly(); break; case FN_FRAME_WRAP_LEFT: |