summaryrefslogtreecommitdiff
path: root/sw/source/ui/shells/basesh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/shells/basesh.cxx')
-rw-r--r--sw/source/ui/shells/basesh.cxx96
1 files changed, 50 insertions, 46 deletions
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 9b38981abbb3..0cee102729a7 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: basesh.cxx,v $
- * $Revision: 1.87 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -38,7 +35,7 @@
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
#endif
-#include <svx/linkmgr.hxx>
+#include <sfx2/linkmgr.hxx>
#include <svx/htmlmode.hxx>
#include <svx/imapdlg.hxx>
#include <sfx2/dispatch.hxx>
@@ -50,27 +47,26 @@
#include <sfx2/objitem.hxx>
#include <svtools/filter.hxx>
#include <svx/gallery.hxx>
-#include <svx/langitem.hxx>
+#include <editeng/langitem.hxx>
#include <svx/clipfmtitem.hxx>
#include <svx/contdlg.hxx>
#include <vcl/graph.hxx>
-#include <svx/impgrf.hxx>
#include <svl/slstitm.hxx>
#include <vcl/msgbox.hxx>
#include <svl/ptitem.hxx>
#include <svl/itemiter.hxx>
#include <svl/stritem.hxx>
-#include <svx/colritem.hxx>
-#include <svx/shaditem.hxx>
-#include <svx/boxitem.hxx>
-#include <svx/srchitem.hxx>
-#include <svx/ulspitem.hxx>
-#include <svx/lrspitem.hxx>
-#include <svx/brshitem.hxx>
-#include <svx/opaqitem.hxx>
-#include <svx/sizeitem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/shaditem.hxx>
+#include <editeng/boxitem.hxx>
+#include <svl/srchitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/opaqitem.hxx>
+#include <editeng/sizeitem.hxx>
#include <svx/flagsdef.hxx>
-#include <svx/scripttypeitem.hxx>
+#include <editeng/scripttypeitem.hxx>
#include <sfx2/objface.hxx>
#include <fmturl.hxx>
#include <fmthdft.hxx>
@@ -100,9 +96,7 @@
#include <tblafmt.hxx>
#include <caption.hxx>
#include <swwait.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
#ifndef _GLOBALS_HRC
#include <globals.hrc>
#endif
@@ -192,7 +186,7 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh )
void* pEditObj = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType
? rSh.GetIMapInventor() : 0;
TargetList* pList = new TargetList;
- rSh.GetView().GetViewFrame()->GetTopFrame()->GetTargetList(*pList);
+ rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList);
SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
rSh.GetFlyFrmAttr( aSet );
@@ -1063,14 +1057,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 );
@@ -1101,7 +1095,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)
@@ -1114,7 +1108,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));
@@ -1126,7 +1120,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));
@@ -1624,12 +1618,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());
@@ -1646,16 +1645,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:
@@ -1705,15 +1704,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:
@@ -1726,7 +1728,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
@@ -1766,7 +1770,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:
@@ -2551,7 +2555,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
SvxBrushItem aBrush(RES_BACKGROUND);
rSh.GetBoxBackground( aBrush );
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
- rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
+ rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
aSet.Put( aBrush );
@@ -2570,7 +2574,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
rSh.GetFlyFrmAttr( aSet );
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
- rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
+ rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
@@ -2585,7 +2589,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
rSh.GetCurAttr( aSet );
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
- rView.GetViewFrame()->GetFrame()->GetFrameInterface(),
+ rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )