2000-09-18 23:08:29 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* $RCSfile: feshview.cxx,v $
|
2008-10-10 13:02:43 +00:00
|
|
|
|
* $Revision: 1.61.136.2 $
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
2008-04-10 13:03:07 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
2006-09-16 20:14:38 +00:00
|
|
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
|
#include "precompiled_sw.hxx"
|
2004-10-04 18:06:57 +00:00
|
|
|
|
#include <com/sun/star/embed/EmbedMisc.hpp>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#include "hintids.hxx"
|
|
|
|
|
|
|
|
|
|
#ifdef WIN
|
|
|
|
|
#define _FESHVIEW_ONLY_INLINE_NEEDED
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
#include <svx/svdobj.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#include <svx/svdouno.hxx>
|
|
|
|
|
#include <svx/svdoole2.hxx>
|
|
|
|
|
#include <svx/svdogrp.hxx>
|
2002-06-24 13:53:54 +00:00
|
|
|
|
#include <svx/svdocirc.hxx>
|
|
|
|
|
#include <svx/svdopath.hxx>
|
|
|
|
|
#include <svx/sxciaitm.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#include <svx/xfillit.hxx>
|
|
|
|
|
#include <svx/svdocapt.hxx>
|
|
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
|
#include <svx/boxitem.hxx>
|
|
|
|
|
#include <svx/opaqitem.hxx>
|
|
|
|
|
#include <svx/protitem.hxx>
|
|
|
|
|
#include <svx/svdpage.hxx>
|
2002-11-07 06:57:51 +00:00
|
|
|
|
#include <svx/svdpagv.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2002-06-24 13:53:54 +00:00
|
|
|
|
#ifndef _POOLFMT_HRC
|
|
|
|
|
#include <poolfmt.hrc> // fuer InitFldTypes
|
|
|
|
|
#endif
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#include <frmfmt.hxx>
|
|
|
|
|
#include <frmatr.hxx>
|
|
|
|
|
#include <fmtfsize.hxx>
|
|
|
|
|
#include <fmtanchr.hxx>
|
|
|
|
|
#include <fmtornt.hxx>
|
|
|
|
|
#include <fmtsrnd.hxx>
|
|
|
|
|
#include <fmtcntnt.hxx>
|
|
|
|
|
#include <fmtflcnt.hxx>
|
|
|
|
|
#include <fmtcnct.hxx>
|
|
|
|
|
#include <docary.hxx>
|
|
|
|
|
#include <tblsel.hxx>
|
|
|
|
|
#include <swtable.hxx>
|
2002-05-30 15:35:18 +00:00
|
|
|
|
#include <flyfrms.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#include "fesh.hxx"
|
|
|
|
|
#include "rootfrm.hxx"
|
|
|
|
|
#include "pagefrm.hxx"
|
|
|
|
|
#include "sectfrm.hxx"
|
|
|
|
|
#include "doc.hxx"
|
|
|
|
|
#include "dview.hxx"
|
|
|
|
|
#include "dflyobj.hxx"
|
|
|
|
|
#include "dcontact.hxx"
|
|
|
|
|
#include "viewimp.hxx"
|
|
|
|
|
#include "flyfrm.hxx"
|
|
|
|
|
#include "pam.hxx"
|
|
|
|
|
#include "ndole.hxx"
|
|
|
|
|
#include "ndgrf.hxx"
|
|
|
|
|
#include "ndtxt.hxx"
|
|
|
|
|
#include "viewopt.hxx" // fuer GetHTMLMode
|
|
|
|
|
#include "swundo.hxx"
|
|
|
|
|
#include "notxtfrm.hxx"
|
|
|
|
|
#include "txtfrm.hxx"
|
|
|
|
|
#include "txatbase.hxx"
|
|
|
|
|
#include "mdiexp.hxx" // fuer Update der Statuszeile bei drag
|
2004-08-02 13:03:20 +00:00
|
|
|
|
// OD 2004-05-24 #i28701#
|
|
|
|
|
#include <sortedobjs.hxx>
|
2006-03-21 14:34:16 +00:00
|
|
|
|
// --> OD 2006-03-06 #125892#
|
|
|
|
|
#include <HandleAnchorNodeChg.hxx>
|
|
|
|
|
// <--
|
2006-11-14 14:09:49 +00:00
|
|
|
|
#include <basegfx/polygon/b2dpolygon.hxx>
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#define SCROLLVAL 75
|
|
|
|
|
|
2004-10-04 18:06:57 +00:00
|
|
|
|
using namespace com::sun::star;
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
//Tattergrenze fuer Drawing-SS
|
|
|
|
|
#define MINMOVE ((USHORT)GetOut()->PixelToLogic(Size(Imp()->GetDrawView()->GetMarkHdlSizePixel()/2,0)).Width())
|
|
|
|
|
|
|
|
|
|
SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh )
|
|
|
|
|
{
|
|
|
|
|
if ( !pLst )
|
2004-07-12 14:47:48 +00:00
|
|
|
|
pLst = pSh->HasDrawView() ? &pSh->Imp()->GetDrawView()->GetMarkedObjectList():0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
if ( pLst && pLst->GetMarkCount() == 1 )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if ( pO->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrm* pOldSelFly)
|
|
|
|
|
{
|
|
|
|
|
const SwFrmFmt *pFlyFmt = pSh->SelFlyGrabCrsr();
|
|
|
|
|
if( pFlyFmt && !pSh->ActionPend() &&
|
|
|
|
|
(!pOldSelFly || pOldSelFly->GetFmt() != pFlyFmt) )
|
|
|
|
|
{
|
|
|
|
|
// dann das evt. gesetzte Macro rufen
|
|
|
|
|
pSh->GetFlyMacroLnk().Call( (void*)pFlyFmt );
|
|
|
|
|
extern BOOL bNoInterrupt; // in swapp.cxx
|
|
|
|
|
// wir in dem Makro ein Dialog gestartet, dann kommt das
|
|
|
|
|
// MouseButtonUp zu diesem und nicht zu uns. Dadurch ist
|
|
|
|
|
// Flag bei uns immer gesetzt und schaltet nie die auf die
|
|
|
|
|
// entsp. Shell um !!!!!!!
|
|
|
|
|
bNoInterrupt = FALSE;
|
|
|
|
|
}
|
|
|
|
|
else if( !pFlyFmt || RES_DRAWFRMFMT == pFlyFmt->Which() )
|
2007-07-31 16:41:19 +00:00
|
|
|
|
{
|
|
|
|
|
// --> OD 2007-07-25 #136039#
|
|
|
|
|
// assure consistent cursor
|
|
|
|
|
pSh->KillPams();
|
|
|
|
|
pSh->ClearMark();
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pSh->SetCrsr( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), TRUE);
|
2007-07-31 16:41:19 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::SelectObj()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 16. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 22. Oct. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2002-04-09 13:21:41 +00:00
|
|
|
|
BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2006-07-13 14:55:32 +00:00
|
|
|
|
SwDrawView *pDView = Imp()->GetDrawView();
|
|
|
|
|
if(!pDView)
|
|
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
StartAction(); //Aktion ist Notwendig, damit nicht mehrere
|
|
|
|
|
//AttrChgdNotify (etwa durch Unmark->MarkListHasChgd)
|
|
|
|
|
//durchkommen
|
|
|
|
|
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = pDView->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
const BOOL bHadSelection = rMrkList.GetMarkCount() ? TRUE : FALSE;
|
2002-04-09 13:21:41 +00:00
|
|
|
|
const BOOL bAddSelect = 0 != (SW_ADD_SELECT & nFlag);
|
|
|
|
|
const BOOL bEnterGroup = 0 != (SW_ENTER_GROUP & nFlag);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwFlyFrm* pOldSelFly = 0;
|
|
|
|
|
const Point aOldPos( pDView->GetAllMarkedRect().TopLeft() );
|
|
|
|
|
|
|
|
|
|
if( bHadSelection )
|
|
|
|
|
{
|
|
|
|
|
//Unmark rufen wenn !bAddSelect oder wenn ein Fly selektiert ist.
|
|
|
|
|
BOOL bUnmark = !bAddSelect;
|
|
|
|
|
|
|
|
|
|
if ( rMrkList.GetMarkCount() == 1 )
|
|
|
|
|
{
|
|
|
|
|
//Wenn ein Fly selektiert ist, so muss er erst deselektiert werden.
|
|
|
|
|
pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
if ( pOldSelFly )
|
|
|
|
|
{
|
|
|
|
|
const USHORT nType = GetCntType();
|
2002-04-09 13:21:41 +00:00
|
|
|
|
if( nType != CNT_TXT || (SW_LEAVE_FRAME & nFlag) ||
|
2000-09-18 23:08:29 +00:00
|
|
|
|
( pOldSelFly->GetFmt()->GetProtect().IsCntntProtected()
|
|
|
|
|
&& !IsReadOnlyAvailable() ))
|
|
|
|
|
{
|
|
|
|
|
//Wenn ein Fly deselektiert wird, der Grafik, Ole o.ae.
|
|
|
|
|
//enthaelt, so muss der Crsr aus diesem entfernt werden.
|
|
|
|
|
//Desgleichen wenn ein Fly mit geschuetztem Inhalt deselektiert
|
|
|
|
|
//wird. Der Einfachheit halber wire der Crsr 'grad so neben die
|
|
|
|
|
//linke obere Ecke gesetzt.
|
|
|
|
|
Point aPt( pOldSelFly->Frm().Pos() );
|
|
|
|
|
aPt.X() -= 1;
|
|
|
|
|
BOOL bUnLockView = !IsViewLocked();
|
|
|
|
|
LockView( TRUE );
|
|
|
|
|
SetCrsr( aPt, TRUE );
|
|
|
|
|
if( bUnLockView )
|
|
|
|
|
LockView( FALSE );
|
|
|
|
|
}
|
|
|
|
|
if ( nType & CNT_GRF &&
|
|
|
|
|
((SwNoTxtFrm*)pOldSelFly->Lower())->HasAnimation() )
|
|
|
|
|
{
|
|
|
|
|
GetWin()->Invalidate( pOldSelFly->Frm().SVRect() );
|
|
|
|
|
}
|
|
|
|
|
bUnmark = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( bUnmark )
|
|
|
|
|
pDView->UnmarkAll();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
KillPams();
|
|
|
|
|
ClearMark();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( pObj )
|
2002-05-15 12:22:47 +00:00
|
|
|
|
{
|
|
|
|
|
ASSERT( !bEnterGroup, "SW_ENTER_GROUP is not supported" );
|
|
|
|
|
pDView->MarkObj( pObj, Imp()->GetPageView() );
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
2002-05-15 12:22:47 +00:00
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pDView->MarkObj( rPt, MINMOVE, bAddSelect, bEnterGroup );
|
2002-05-15 12:22:47 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
const BOOL bRet = 0 != rMrkList.GetMarkCount();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
if ( rMrkList.GetMarkCount() > 1 )
|
|
|
|
|
{
|
|
|
|
|
//Ganz dumm ist es, wenn Zeichenobjekte Selektiert waren und
|
|
|
|
|
//nun ein Fly hinzuselektiert wird.
|
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SdrObject *pTmpObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
|
|
|
|
BOOL bForget = pTmpObj->ISA(SwVirtFlyDrawObj);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( bForget )
|
|
|
|
|
{
|
|
|
|
|
pDView->UnmarkAll();
|
2007-09-27 07:51:28 +00:00
|
|
|
|
if ( pTmpObj )
|
|
|
|
|
pDView->MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
|
|
|
|
pDView->MarkObj( rPt, MINMOVE );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( bRet )
|
|
|
|
|
{
|
|
|
|
|
::lcl_GrabCursor(this, pOldSelFly);
|
|
|
|
|
if ( GetCntType() & CNT_GRF )
|
|
|
|
|
{
|
|
|
|
|
const SwFlyFrm *pTmp = GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
ASSERT( pTmp, "Graphic without Fly" );
|
|
|
|
|
if ( ((SwNoTxtFrm*)pTmp->Lower())->HasAnimation() )
|
|
|
|
|
((SwNoTxtFrm*)pTmp->Lower())->StopAnimation( GetOut() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ( !pOldSelFly && bHadSelection )
|
|
|
|
|
SetCrsr( aOldPos, TRUE);
|
|
|
|
|
|
|
|
|
|
if( bRet || !bHadSelection )
|
|
|
|
|
CallChgLnk();
|
|
|
|
|
|
|
|
|
|
// update der Statuszeile
|
|
|
|
|
::FrameNotify( this, bRet ? FLY_DRAG_START : FLY_DRAG_END );
|
|
|
|
|
|
|
|
|
|
EndAction();
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-30 15:35:18 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
|
|
|
|
|
|*
|
|
|
|
|
|* Created AMA 05/28/2002
|
|
|
|
|
|* Last modify AMA 05/30/2002
|
|
|
|
|
|*
|
|
|
|
|
|* Description: MoveAnchor( nDir ) looked for an another Anchor for
|
|
|
|
|
|* the selected drawing object (or fly frame) in the given direction.
|
|
|
|
|
|* An object "as character" doesn't moves anyway.
|
|
|
|
|
|* A page bounded object could move to the previous/next page with up/down,
|
|
|
|
|
|* an object bounded "at paragraph" moves to the previous/next paragraph, too.
|
|
|
|
|
|* An object bounded "at character" moves to the previous/next paragraph
|
|
|
|
|
|* with up/down and to the previous/next character with left/right.
|
|
|
|
|
|* If the anchor for at paragraph/character bounded objects has vertical or
|
|
|
|
|
|* right_to_left text direction, the directions for up/down/left/right will
|
|
|
|
|
|* interpreted accordingly.
|
|
|
|
|
|* An object bounded "at fly" takes the center of the actual anchor and looks
|
|
|
|
|
|* for the nearest fly frame in the given direction.
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define LESS_X( aPt1, aPt2, bOld ) ( aPt1.X() < aPt2.X() || \
|
|
|
|
|
( aPt1.X() == aPt2.X() && ( aPt1.Y() < aPt2.Y() || \
|
|
|
|
|
( aPt1.Y() == aPt2.Y() && bOld ) ) ) )
|
|
|
|
|
#define LESS_Y( aPt1, aPt2, bOld ) ( aPt1.Y() < aPt2.Y() || \
|
|
|
|
|
( aPt1.Y() == aPt2.Y() && ( aPt1.X() < aPt2.X() || \
|
|
|
|
|
( aPt1.X() == aPt2.X() && bOld ) ) ) )
|
2002-05-28 13:05:17 +00:00
|
|
|
|
|
|
|
|
|
sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
|
|
|
|
|
{
|
|
|
|
|
const SdrMarkList* pMrkList;
|
|
|
|
|
if( !Imp()->GetDrawView() ||
|
2004-07-12 14:47:48 +00:00
|
|
|
|
0 == (pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList()) ||
|
2002-05-28 13:05:17 +00:00
|
|
|
|
1 != pMrkList->GetMarkCount())
|
|
|
|
|
return sal_False;
|
|
|
|
|
SwFrm* pOld;
|
2002-05-30 15:35:18 +00:00
|
|
|
|
SwFlyFrm* pFly = NULL;
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if( pObj->ISA(SwVirtFlyDrawObj) )
|
2002-05-30 15:35:18 +00:00
|
|
|
|
{
|
|
|
|
|
pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pOld = pFly->AnchorFrm();
|
2002-05-30 15:35:18 +00:00
|
|
|
|
}
|
2002-05-28 13:05:17 +00:00
|
|
|
|
else
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pOld = ((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
|
2002-05-30 15:35:18 +00:00
|
|
|
|
sal_Bool bRet = sal_False;
|
2002-05-28 13:05:17 +00:00
|
|
|
|
if( pOld )
|
|
|
|
|
{
|
2002-05-30 15:35:18 +00:00
|
|
|
|
SwFrm* pNew = pOld;
|
2004-08-02 13:03:20 +00:00
|
|
|
|
// --> OD 2004-07-16 #i28701#
|
|
|
|
|
SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
|
|
|
|
|
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
|
|
|
|
|
SwFmtAnchor aAnch( rFmt.GetAnchor() );
|
2002-05-30 15:35:18 +00:00
|
|
|
|
RndStdIds nAnchorId = aAnch.GetAnchorId();
|
|
|
|
|
if ( FLY_IN_CNTNT == nAnchorId )
|
|
|
|
|
return sal_False;
|
|
|
|
|
if( pOld->IsVertical() )
|
|
|
|
|
{
|
|
|
|
|
if( pOld->IsTxtFrm() )
|
|
|
|
|
{
|
|
|
|
|
switch( nDir ) {
|
|
|
|
|
case SW_MOVE_UP: nDir = SW_MOVE_LEFT; break;
|
|
|
|
|
case SW_MOVE_DOWN: nDir = SW_MOVE_RIGHT; break;
|
|
|
|
|
case SW_MOVE_LEFT: nDir = SW_MOVE_DOWN; break;
|
|
|
|
|
case SW_MOVE_RIGHT: nDir = SW_MOVE_UP; break;
|
|
|
|
|
}
|
|
|
|
|
if( pOld->IsRightToLeft() )
|
|
|
|
|
{
|
|
|
|
|
if( nDir == SW_MOVE_LEFT )
|
|
|
|
|
nDir = SW_MOVE_RIGHT;
|
|
|
|
|
else if( nDir == SW_MOVE_RIGHT )
|
|
|
|
|
nDir = SW_MOVE_LEFT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch ( nAnchorId ) {
|
|
|
|
|
case FLY_PAGE:
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pOld->IsPageFrm(), "Wrong anchor, page exspected." );
|
|
|
|
|
if( SW_MOVE_UP == nDir )
|
|
|
|
|
pNew = pOld->GetPrev();
|
|
|
|
|
else if( SW_MOVE_DOWN == nDir )
|
|
|
|
|
pNew = pOld->GetNext();
|
|
|
|
|
if( pNew && pNew != pOld )
|
|
|
|
|
{
|
|
|
|
|
aAnch.SetPageNum( ((SwPageFrm*)pNew)->GetPhyPageNum() );
|
|
|
|
|
bRet = sal_True;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case FLY_AUTO_CNTNT:
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
|
|
|
|
|
if( SW_MOVE_LEFT == nDir || SW_MOVE_RIGHT == nDir )
|
|
|
|
|
{
|
|
|
|
|
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
|
|
|
|
|
SwTxtNode* pTxtNd = ((SwTxtFrm*)pOld)->GetTxtNode();
|
|
|
|
|
xub_StrLen nAct = pPos->nContent.GetIndex();
|
|
|
|
|
if( SW_MOVE_LEFT == nDir )
|
|
|
|
|
{
|
|
|
|
|
bRet = sal_True;
|
|
|
|
|
if( nAct )
|
|
|
|
|
{
|
|
|
|
|
--nAct;
|
|
|
|
|
pPos->nContent.Assign( pTxtNd, nAct );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nDir = SW_MOVE_UP;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
xub_StrLen nMax =
|
|
|
|
|
((SwTxtFrm*)pOld)->GetTxtNode()->GetTxt().Len();
|
|
|
|
|
if( nAct < nMax )
|
|
|
|
|
{
|
|
|
|
|
++nAct;
|
|
|
|
|
bRet = sal_True;
|
|
|
|
|
pPos->nContent.Assign( pTxtNd, nAct );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nDir = SW_MOVE_DOWN;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} // no break!
|
|
|
|
|
case FLY_AT_CNTNT:
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." );
|
|
|
|
|
if( SW_MOVE_UP == nDir )
|
|
|
|
|
pNew = pOld->FindPrev();
|
|
|
|
|
else if( SW_MOVE_DOWN == nDir )
|
|
|
|
|
pNew = pOld->FindNext();
|
|
|
|
|
if( pNew && pNew != pOld && pNew->IsCntntFrm() )
|
|
|
|
|
{
|
|
|
|
|
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
|
|
|
|
|
SwTxtNode* pTxtNd = ((SwTxtFrm*)pNew)->GetTxtNode();
|
|
|
|
|
pPos->nNode = *pTxtNd;
|
|
|
|
|
xub_StrLen nTmp = 0;
|
|
|
|
|
if( bRet )
|
|
|
|
|
{
|
|
|
|
|
nTmp = ((SwTxtFrm*)pNew)->GetTxtNode()->GetTxt().Len();
|
|
|
|
|
if( nTmp )
|
|
|
|
|
--nTmp;
|
|
|
|
|
}
|
|
|
|
|
pPos->nContent.Assign( pTxtNd, nTmp );
|
|
|
|
|
bRet = sal_True;
|
|
|
|
|
}
|
|
|
|
|
else if( SW_MOVE_UP == nDir || SW_MOVE_DOWN == nDir )
|
|
|
|
|
bRet = sal_False;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case FLY_AT_FLY:
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pOld->IsFlyFrm(), "Wrong anchor, fly frame exspected.");
|
|
|
|
|
SwPageFrm* pPage = pOld->FindPageFrm();
|
|
|
|
|
ASSERT( pPage, "Where's my page?" );
|
|
|
|
|
SwFlyFrm* pNewFly = NULL;
|
|
|
|
|
if( pPage->GetSortedObjs() )
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
sal_Bool bOld = sal_False;
|
|
|
|
|
Point aCenter( pOld->Frm().Left() + pOld->Frm().Width()/2,
|
|
|
|
|
pOld->Frm().Top() + pOld->Frm().Height()/2 );
|
|
|
|
|
Point aBest;
|
|
|
|
|
for( i = 0; (USHORT)i<pPage->GetSortedObjs()->Count(); ++i )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwAnchoredObject* pAnchObj =
|
2004-08-02 13:03:20 +00:00
|
|
|
|
(*pPage->GetSortedObjs())[i];
|
2007-09-27 07:51:28 +00:00
|
|
|
|
if( pAnchObj->ISA(SwFlyFrm) )
|
2002-05-30 15:35:18 +00:00
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(pAnchObj);
|
2002-05-30 15:35:18 +00:00
|
|
|
|
if( pTmp == pOld )
|
|
|
|
|
bOld = sal_True;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const SwFlyFrm* pCheck = pFly ? pTmp : 0;
|
|
|
|
|
while( pCheck )
|
|
|
|
|
{
|
|
|
|
|
if( pCheck == pFly )
|
|
|
|
|
break;
|
2004-06-28 12:34:54 +00:00
|
|
|
|
const SwFrm *pNxt = pCheck->GetAnchorFrm();
|
2002-05-30 15:35:18 +00:00
|
|
|
|
pCheck = pNxt ? pNxt->FindFlyFrm() : NULL;
|
|
|
|
|
}
|
|
|
|
|
if( pCheck || pTmp->IsProtected() )
|
|
|
|
|
continue;
|
|
|
|
|
Point aNew( pTmp->Frm().Left() +
|
|
|
|
|
pTmp->Frm().Width()/2,
|
|
|
|
|
pTmp->Frm().Top() +
|
|
|
|
|
pTmp->Frm().Height()/2 );
|
|
|
|
|
sal_Bool bAccept = sal_False;
|
|
|
|
|
switch( nDir ) {
|
|
|
|
|
case SW_MOVE_RIGHT:
|
|
|
|
|
{
|
|
|
|
|
bAccept = LESS_X( aCenter, aNew, bOld )
|
|
|
|
|
&& ( !pNewFly ||
|
|
|
|
|
LESS_X( aNew, aBest, sal_False ) );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SW_MOVE_LEFT:
|
|
|
|
|
{
|
|
|
|
|
bAccept = LESS_X( aNew, aCenter, !bOld )
|
|
|
|
|
&& ( !pNewFly ||
|
|
|
|
|
LESS_X( aBest, aNew, sal_True ) );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SW_MOVE_UP:
|
|
|
|
|
{
|
|
|
|
|
bAccept = LESS_Y( aNew, aCenter, !bOld )
|
|
|
|
|
&& ( !pNewFly ||
|
|
|
|
|
LESS_Y( aBest, aNew, sal_True ) );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SW_MOVE_DOWN:
|
|
|
|
|
{
|
|
|
|
|
bAccept = LESS_Y( aCenter, aNew, bOld )
|
|
|
|
|
&& ( !pNewFly ||
|
|
|
|
|
LESS_Y( aNew, aBest, sal_False ) );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( bAccept )
|
|
|
|
|
{
|
|
|
|
|
pNewFly = pTmp;
|
|
|
|
|
aBest = aNew;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( pNewFly )
|
|
|
|
|
{
|
|
|
|
|
SwPosition aPos( *pNewFly->GetFmt()->
|
|
|
|
|
GetCntnt().GetCntntIdx());
|
|
|
|
|
aAnch.SetAnchor( &aPos );
|
|
|
|
|
bRet = sal_True;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2007-09-27 07:51:28 +00:00
|
|
|
|
default: break;
|
2002-05-30 15:35:18 +00:00
|
|
|
|
}
|
|
|
|
|
if( bRet )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
2006-03-21 14:34:16 +00:00
|
|
|
|
// --> OD 2006-02-28 #125892#
|
|
|
|
|
// handle change of anchor node:
|
|
|
|
|
// if count of the anchor frame also change, the fly frames have to be
|
|
|
|
|
// re-created. Thus, delete all fly frames except the <this> before the
|
|
|
|
|
// anchor attribute is change and re-create them afterwards.
|
|
|
|
|
{
|
|
|
|
|
SwHandleAnchorNodeChg* pHandleAnchorNodeChg( 0L );
|
|
|
|
|
SwFlyFrmFmt* pFlyFrmFmt( dynamic_cast<SwFlyFrmFmt*>(&rFmt) );
|
|
|
|
|
if ( pFlyFrmFmt )
|
|
|
|
|
{
|
|
|
|
|
pHandleAnchorNodeChg =
|
|
|
|
|
new SwHandleAnchorNodeChg( *pFlyFrmFmt, aAnch );
|
|
|
|
|
}
|
|
|
|
|
rFmt.GetDoc()->SetAttr( aAnch, rFmt );
|
|
|
|
|
delete pHandleAnchorNodeChg;
|
|
|
|
|
}
|
|
|
|
|
// <--
|
2004-08-02 13:03:20 +00:00
|
|
|
|
// --> OD 2004-06-24 #i28701# - no call of method
|
|
|
|
|
// <CheckCharRectAndTopOfLine()> for to-character anchored
|
|
|
|
|
// Writer fly frame needed. This method call can cause a
|
|
|
|
|
// format of the anchor frame, which is no longer intended.
|
|
|
|
|
// Instead clear the anchor character rectangle and
|
|
|
|
|
// the top of line values for all to-character anchored objects.
|
|
|
|
|
pAnchoredObj->ClearCharRectAndTopOfLine();
|
2002-05-30 15:35:18 +00:00
|
|
|
|
EndAllAction();
|
2002-05-28 13:05:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2002-05-30 15:35:18 +00:00
|
|
|
|
return bRet;
|
2002-05-28 13:05:17 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::GetSelFrmType()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 12. Jan. 93
|
|
|
|
|
|* Letzte Aenderung JP 19.03.96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2003-07-04 12:20:40 +00:00
|
|
|
|
const SdrMarkList* SwFEShell::_GetMarkList() const
|
|
|
|
|
{
|
|
|
|
|
const SdrMarkList* pMarkList = NULL;
|
|
|
|
|
if( Imp()->GetDrawView() != NULL )
|
2004-07-12 14:47:48 +00:00
|
|
|
|
pMarkList = &Imp()->GetDrawView()->GetMarkedObjectList();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
return pMarkList;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
USHORT SwFEShell::GetSelFrmType() const
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
USHORT eType;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// get marked frame list, and check if anything is selected
|
|
|
|
|
const SdrMarkList* pMarkList = _GetMarkList();
|
|
|
|
|
if( pMarkList == NULL || pMarkList->GetMarkCount() == 0 )
|
|
|
|
|
eType = FRMTYPE_NONE;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// obtain marked item as fly frame; if no fly frame, it must
|
|
|
|
|
// be a draw object
|
|
|
|
|
const SwFlyFrm* pFly = ::GetFlyFromMarked(pMarkList, (ViewShell*)this);
|
|
|
|
|
if ( pFly != NULL )
|
|
|
|
|
{
|
|
|
|
|
if( pFly->IsFlyLayFrm() )
|
|
|
|
|
eType = FRMTYPE_FLY_FREE;
|
|
|
|
|
else if( pFly->IsFlyAtCntFrm() )
|
|
|
|
|
eType = FRMTYPE_FLY_ATCNT;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pFly->IsFlyInCntFrm(), "Neuer Rahmentyp?" );
|
|
|
|
|
eType = FRMTYPE_FLY_INCNT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
eType = FRMTYPE_DRAWOBJ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return eType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// #108784# does the draw selection contain a control?
|
|
|
|
|
bool SwFEShell::IsSelContainsControl() const
|
|
|
|
|
{
|
|
|
|
|
bool bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// basically, copy the mechanism from GetSelFrmType(), but call
|
|
|
|
|
// CheckControl... if you get a drawing object
|
|
|
|
|
const SdrMarkList* pMarkList = _GetMarkList();
|
|
|
|
|
if( pMarkList != NULL && pMarkList->GetMarkCount() == 1 )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// if we have one marked object, get the SdrObject and check
|
|
|
|
|
// whether it contains a control
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
bRet = CheckControlLayer( pSdrObject );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
2003-07-04 12:20:40 +00:00
|
|
|
|
return bRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::Scroll()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 27. Jul. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
void SwFEShell::ScrollTo( const Point &rPt )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
const SwRect aRect( rPt, rPt );
|
|
|
|
|
if ( IsScrollMDI( this, aRect ) &&
|
2004-07-12 14:47:48 +00:00
|
|
|
|
(!Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ||
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Imp()->IsDragPossible( rPt )) )
|
|
|
|
|
{
|
2006-11-14 14:09:49 +00:00
|
|
|
|
//SwSaveHdl aSave( Imp() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
ScrollMDI( this, aRect, SCROLLVAL, SCROLLVAL );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::SetDragMode()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 30. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 30. Jan. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SetDragMode( UINT16 eDragMode )
|
|
|
|
|
{
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
Imp()->GetDrawView()->SetDragMode( (SdrDragMode)eDragMode );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BeginDrag()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MS 10.06.92
|
|
|
|
|
|* Letzte Aenderung MA 13. Mar. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
long SwFEShell::BeginDrag( const Point* pPt, BOOL )
|
|
|
|
|
{
|
|
|
|
|
SdrView *pView = Imp()->GetDrawView();
|
2004-07-12 14:47:48 +00:00
|
|
|
|
if ( pView && pView->AreObjectsMarked() )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
delete pChainFrom; delete pChainTo; pChainFrom = pChainTo = 0;
|
2006-11-14 14:09:49 +00:00
|
|
|
|
SdrHdl* pHdl = pView->PickHandle( *pPt );
|
|
|
|
|
pView->BegDragObj( *pPt, 0 /*GetWin()*/, pHdl );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::Drag()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MS 10.06.92
|
|
|
|
|
|* Letzte Aenderung MA 13. Mar. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
long SwFEShell::Drag( const Point *pPt, BOOL )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "Drag without DrawView?" );
|
|
|
|
|
if ( Imp()->GetDrawView()->IsDragObj() )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
ScrollTo( *pPt );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Imp()->GetDrawView()->MovDragObj( *pPt );
|
|
|
|
|
Imp()->GetDrawView()->ShowDragAnchor();
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::EndDrag()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MS 10.06.92
|
|
|
|
|
|* Letzte Aenderung MA 13. Mar. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
long SwFEShell::EndDrag( const Point *, BOOL )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "EndDrag without DrawView?" );
|
|
|
|
|
SdrView *pView = Imp()->GetDrawView();
|
|
|
|
|
if ( pView->IsDragObj() )
|
|
|
|
|
{
|
|
|
|
|
//Start-/EndActions nur an der ViewShell aufsetzen
|
|
|
|
|
ViewShell *pSh = this;
|
|
|
|
|
do {
|
|
|
|
|
pSh->StartAction();
|
|
|
|
|
} while ( this != (pSh = (ViewShell*)pSh->GetNext()) );
|
|
|
|
|
|
|
|
|
|
StartUndo( UNDO_START );
|
|
|
|
|
|
|
|
|
|
//#50778# Bug im Draging: Im StartAction wird ein HideShowXor gerufen.
|
|
|
|
|
//Im EndDragObj() wird dies unsinniger und faelschlicherweise wieder
|
|
|
|
|
//Rueckgaengig gemacht. Um Konsistenz herzustellen muessen wir das
|
|
|
|
|
//Xor also wieder zur Anzeige bringen.
|
2002-01-29 09:41:09 +00:00
|
|
|
|
|
|
|
|
|
// Reanimation from the hack #50778 to fix bug #97057
|
|
|
|
|
// May be not the best solution, but the one with lowest risc at the moment.
|
2006-11-14 14:09:49 +00:00
|
|
|
|
//pView->ShowShownXor( GetOut() );
|
2002-01-29 09:41:09 +00:00
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pView->EndDragObj();
|
|
|
|
|
// JP 18.08.95: DrawUndo-Action auf FlyFrames werden nicht gespeichert
|
|
|
|
|
// Die Fly aendern das Flag
|
|
|
|
|
GetDoc()->SetNoDrawUndoObj( FALSE );
|
|
|
|
|
ChgAnchor( 0, TRUE );
|
|
|
|
|
|
|
|
|
|
EndUndo( UNDO_END );
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
pSh->EndAction();
|
|
|
|
|
if( pSh->IsA( TYPE( SwCrsrShell ) ) )
|
|
|
|
|
((SwCrsrShell*)pSh)->CallChgLnk();
|
|
|
|
|
} while ( this != (pSh = (ViewShell*)pSh->GetNext()) );
|
|
|
|
|
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BreakDrag()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 02. Okt. 95
|
|
|
|
|
|* Letzte Aenderung OM 02. Okt. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::BreakDrag()
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "BreakDrag without DrawView?" );
|
|
|
|
|
if ( Imp()->GetDrawView()->IsDragObj() )
|
|
|
|
|
Imp()->GetDrawView()->BrkDragObj();
|
|
|
|
|
SetChainMarker();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::SelFlyGrabCrsr()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in
|
|
|
|
|
|* den ersten CntntFrm
|
|
|
|
|
|* Ersterstellung MA 11. Dec. 92
|
|
|
|
|
|* Letzte Aenderung MA 07. Oct. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
|
|
|
|
|
{
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
|
|
|
|
|
if( pFly )
|
|
|
|
|
{
|
2004-08-02 13:03:20 +00:00
|
|
|
|
// --> OD 2004-06-11 #i28701# - no format here
|
|
|
|
|
// pFly->GetAnchorFrm()->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwCntntFrm *pCFrm = pFly->ContainsCntnt();
|
|
|
|
|
if ( pCFrm )
|
|
|
|
|
{
|
|
|
|
|
SwCntntNode *pCNode = pCFrm->GetNode();
|
2007-07-31 16:41:19 +00:00
|
|
|
|
// --> OD 2007-07-25 #126039#
|
|
|
|
|
// assure, that the cursor is consistent.
|
|
|
|
|
KillPams();
|
|
|
|
|
ClearMark();
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwPaM *pCrsr = GetCrsr();
|
|
|
|
|
|
|
|
|
|
pCrsr->GetPoint()->nNode = *pCNode;
|
|
|
|
|
pCrsr->GetPoint()->nContent.Assign( pCNode, 0 );
|
|
|
|
|
|
|
|
|
|
SwRect& rChrRect = (SwRect&)GetCharRect();
|
|
|
|
|
rChrRect = pFly->Prt();
|
|
|
|
|
rChrRect.Pos() += pFly->Frm().Pos();
|
|
|
|
|
GetCrsrDocPos() = rChrRect.Pos();
|
|
|
|
|
}
|
|
|
|
|
return pFly->GetFmt();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::SelectionToTop(), SelectionToBottom()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Selektion nach oben/unten (Z-Order)
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 05. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 03. Jun. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void lcl_NotifyNeighbours( const SdrMarkList *pLst )
|
|
|
|
|
{
|
|
|
|
|
//Die Regeln fuer die Ausweichmanoever haben sich veraendert.
|
|
|
|
|
//1. Die Umgebung des Fly und aller innenliegenden muss benachrichtigt
|
|
|
|
|
// werden.
|
|
|
|
|
//2. Der Inhalt des Rahmen selbst muss benachrichtigt werden.
|
|
|
|
|
//3. Rahmen die dem Rahmen ausweichen bzw. wichen muessen benachrichtigt werden.
|
|
|
|
|
//4. Auch Zeichenobjekte koennen Rahmen verdraengen
|
|
|
|
|
|
|
|
|
|
for( USHORT j = 0; j < pLst->GetMarkCount(); ++j )
|
|
|
|
|
{
|
|
|
|
|
SwPageFrm *pPage;
|
|
|
|
|
BOOL bCheckNeighbours = FALSE;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
sal_Int16 aHori = text::HoriOrientation::NONE;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwRect aRect;
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if ( pO->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
|
|
|
|
|
|
|
|
|
|
const SwFmtHoriOrient &rHori = pFly->GetFmt()->GetHoriOrient();
|
|
|
|
|
aHori = rHori.GetHoriOrient();
|
2007-09-27 07:51:28 +00:00
|
|
|
|
if( text::HoriOrientation::NONE != aHori && text::HoriOrientation::CENTER != aHori &&
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pFly->IsFlyAtCntFrm() )
|
|
|
|
|
{
|
|
|
|
|
bCheckNeighbours = TRUE;
|
|
|
|
|
pFly->InvalidatePos();
|
|
|
|
|
pFly->Frm().Pos().Y() += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pPage = pFly->FindPageFrm();
|
|
|
|
|
aRect = pFly->Frm();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-06-28 12:34:54 +00:00
|
|
|
|
SwFrm* pAnch = ( (SwDrawContact*)GetUserCall(pO) )->GetAnchorFrm( pO );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( !pAnch )
|
|
|
|
|
continue;
|
|
|
|
|
pPage = pAnch->FindPageFrm();
|
2006-09-15 10:41:08 +00:00
|
|
|
|
// --> OD 2006-08-15 #i68520# - naming changed
|
|
|
|
|
aRect = GetBoundRectOfAnchoredObj( pO );
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-08-02 13:03:20 +00:00
|
|
|
|
sal_uInt32 nCount = pPage->GetSortedObjs() ? pPage->GetSortedObjs()->Count() : 0;
|
|
|
|
|
for ( sal_uInt32 i = 0; i < nCount; ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2004-08-02 13:03:20 +00:00
|
|
|
|
SwAnchoredObject* pAnchoredObj = (*pPage->GetSortedObjs())[i];
|
|
|
|
|
if ( !pAnchoredObj->ISA(SwFlyFrm) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
2004-08-02 13:03:20 +00:00
|
|
|
|
SwFlyFrm* pAct = static_cast<SwFlyFrm*>(pAnchoredObj);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwRect aTmpCalcPnt( pAct->Prt() );
|
|
|
|
|
aTmpCalcPnt += pAct->Frm().Pos();
|
|
|
|
|
if ( aRect.IsOver( aTmpCalcPnt ) )
|
|
|
|
|
{
|
|
|
|
|
SwCntntFrm *pCnt = pAct->ContainsCntnt();
|
|
|
|
|
while ( pCnt )
|
|
|
|
|
{
|
|
|
|
|
aTmpCalcPnt = pCnt->Prt();
|
|
|
|
|
aTmpCalcPnt += pCnt->Frm().Pos();
|
|
|
|
|
if ( aRect.IsOver( aTmpCalcPnt ) )
|
|
|
|
|
((SwFrm*)pCnt)->Prepare( PREP_FLY_ATTR_CHG );
|
|
|
|
|
pCnt = pCnt->GetNextCntntFrm();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( bCheckNeighbours && pAct->IsFlyAtCntFrm() )
|
|
|
|
|
{
|
|
|
|
|
const SwFmtHoriOrient &rH = pAct->GetFmt()->GetHoriOrient();
|
|
|
|
|
if ( rH.GetHoriOrient() == aHori &&
|
|
|
|
|
pAct->Frm().Top() <= aRect.Bottom() &&
|
|
|
|
|
pAct->Frm().Bottom() >= aRect.Top() )
|
|
|
|
|
{
|
|
|
|
|
pAct->InvalidatePos();
|
|
|
|
|
pAct->Frm().Pos().Y() += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SelectionToTop( BOOL bTop )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "SelectionToTop without DrawView?" );
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
|
|
|
|
|
|
|
|
|
|
SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
if ( pFly && pFly->IsFlyInCntFrm() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
StartAllAction();
|
|
|
|
|
if ( bTop )
|
|
|
|
|
Imp()->GetDrawView()->PutMarkedToTop();
|
|
|
|
|
else
|
|
|
|
|
Imp()->GetDrawView()->MovMarkedToTop();
|
|
|
|
|
::lcl_NotifyNeighbours( &rMrkList );
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SelectionToBottom( BOOL bBottom )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "SelectionToBottom without DrawView?" );
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
ASSERT( rMrkList.GetMarkCount(), "Kein Object Selektiert." );
|
|
|
|
|
|
|
|
|
|
SwFlyFrm *pFly = ::GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
if ( pFly && pFly->IsFlyInCntFrm() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
StartAllAction();
|
|
|
|
|
if ( bBottom )
|
|
|
|
|
Imp()->GetDrawView()->PutMarkedToBtm();
|
|
|
|
|
else
|
|
|
|
|
Imp()->GetDrawView()->MovMarkedToBtm();
|
|
|
|
|
::lcl_NotifyNeighbours( &rMrkList );
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::GetLayerId()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Objekt ueber/unter dem Dokument?
|
|
|
|
|
|* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 20. Dec. 94
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
short SwFEShell::GetLayerId() const
|
|
|
|
|
{
|
|
|
|
|
short nRet = SHRT_MAX;
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( nRet == SHRT_MAX )
|
|
|
|
|
nRet = pObj->GetLayer();
|
|
|
|
|
else if ( nRet != pObj->GetLayer() )
|
|
|
|
|
{
|
|
|
|
|
nRet = -1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( nRet == SHRT_MAX )
|
|
|
|
|
nRet = -1;
|
|
|
|
|
return nRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::SelectionToHeaven(), SelectionToHell()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Objekt ueber/unter dem Dokument
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung AMA 04. Jun. 98
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 25.06.2003 #108784#
|
|
|
|
|
// Note: only visible objects can be marked. Thus, objects with invisible
|
|
|
|
|
// layer IDs have not to be considered.
|
|
|
|
|
// If <SwFEShell> exists, layout exists!!
|
|
|
|
|
void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2006-08-14 15:15:42 +00:00
|
|
|
|
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 25.06.2003 #108784# - correct type of <nControls>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-08-27 15:30:53 +00:00
|
|
|
|
// OD 21.08.2003 #i18447# - no change of layer for controls
|
|
|
|
|
// or group objects containing controls.
|
|
|
|
|
const bool bControlObj = ::CheckControlLayer( pObj );
|
|
|
|
|
//if ( pObj->GetLayer() != nLayerId && pObj->GetLayer() != nControls )
|
|
|
|
|
if ( !bControlObj && pObj->GetLayer() != nLayerId )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
pObj->SetLayer( nLayerId );
|
2003-11-24 15:03:25 +00:00
|
|
|
|
InvalidateWindows( SwRect( pObj->GetCurrentBoundRect() ) );
|
|
|
|
|
if ( pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
SwFmt *pFmt = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetFmt();
|
|
|
|
|
SvxOpaqueItem aOpa( pFmt->GetOpaque() );
|
2006-08-14 15:15:42 +00:00
|
|
|
|
aOpa.SetValue( nLayerId == pIDDMA->GetHellId() );
|
2008-06-13 08:47:50 +00:00
|
|
|
|
pFmt->SetFmtAttr( aOpa );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SelectionToHeaven()
|
|
|
|
|
{
|
2006-08-14 15:15:42 +00:00
|
|
|
|
ChangeOpaque( getIDocumentDrawModelAccess()->GetHeavenId() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SelectionToHell()
|
|
|
|
|
{
|
2006-08-14 15:15:42 +00:00
|
|
|
|
ChangeOpaque( getIDocumentDrawModelAccess()->GetHellId() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::IsObjSelected(), IsFrmSelected()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 16. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 17. Jan. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
USHORT SwFEShell::IsObjSelected() const
|
|
|
|
|
{
|
|
|
|
|
if ( IsFrmSelected() || !Imp()->HasDrawView() )
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
2004-07-12 14:47:48 +00:00
|
|
|
|
return USHORT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::IsFrmSelected() const
|
|
|
|
|
{
|
|
|
|
|
if ( !Imp()->HasDrawView() )
|
|
|
|
|
return FALSE;
|
|
|
|
|
else
|
2004-07-12 14:47:48 +00:00
|
|
|
|
return 0 != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(),
|
2000-09-18 23:08:29 +00:00
|
|
|
|
(ViewShell*)this );
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-15 12:22:47 +00:00
|
|
|
|
sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
|
|
|
|
|
{
|
|
|
|
|
if ( IsFrmSelected() || !Imp()->HasDrawView() )
|
|
|
|
|
return sal_False;
|
|
|
|
|
else
|
|
|
|
|
return Imp()->GetDrawView()
|
|
|
|
|
->IsObjMarked( const_cast< SdrObject * >( &rObj ) );
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::EndTextEdit()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 19. Feb. 96
|
|
|
|
|
|* Letzte Aenderung MA 19. Feb. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::EndTextEdit()
|
|
|
|
|
{
|
|
|
|
|
//Beenden des TextEditModus. Wenn gewuenscht (default wenn das Objekt
|
|
|
|
|
//keinen Text mehr enthaelt und keine Attribute traegt) wird das
|
2007-09-27 07:51:28 +00:00
|
|
|
|
//Objekt gel<65>scht. Alle anderen markierten Objekte bleiben erhalten.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
ASSERT( Imp()->HasDrawView() && Imp()->GetDrawView()->IsTextEdit(),
|
|
|
|
|
"EndTextEdit an no Object" );
|
|
|
|
|
|
|
|
|
|
StartAllAction();
|
|
|
|
|
SdrView *pView = Imp()->GetDrawView();
|
|
|
|
|
SdrObject *pObj = pView->GetTextEditObject();
|
|
|
|
|
SdrObjUserCall* pUserCall;
|
|
|
|
|
if( 0 != ( pUserCall = GetUserCall(pObj) ) )
|
|
|
|
|
{
|
2002-01-31 08:41:44 +00:00
|
|
|
|
SdrObject *pTmp = ((SwContact*)pUserCall)->GetMaster();
|
|
|
|
|
if( !pTmp )
|
|
|
|
|
pTmp = pObj;
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pUserCall->Changed( *pTmp, SDRUSERCALL_RESIZE, pTmp->GetLastBoundRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
if ( !pObj->GetUpGroup() )
|
|
|
|
|
{
|
2006-11-14 14:09:49 +00:00
|
|
|
|
if ( SDRENDTEXTEDIT_SHOULDBEDELETED == pView->SdrEndTextEdit(sal_True) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
if ( pView->GetMarkedObjectList().GetMarkCount() > 1 )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
SdrMarkList aSave( pView->GetMarkedObjectList() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
aSave.DeleteMark( aSave.FindObject( pObj ) );
|
|
|
|
|
if ( aSave.GetMarkCount() )
|
|
|
|
|
{
|
|
|
|
|
pView->UnmarkAll();
|
|
|
|
|
pView->MarkObj( pObj, Imp()->GetPageView() );
|
|
|
|
|
}
|
|
|
|
|
DelSelectedObj();
|
|
|
|
|
if ( aSave.GetMarkCount() )
|
|
|
|
|
{
|
|
|
|
|
for ( USHORT i = 0; i < aSave.GetMarkCount(); ++i )
|
2006-07-25 11:33:25 +00:00
|
|
|
|
pView->MarkObj( aSave.GetMark( i )->GetMarkedSdrObj(),
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Imp()->GetPageView() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
DelSelectedObj();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
2006-11-14 14:09:49 +00:00
|
|
|
|
pView->SdrEndTextEdit();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::IsInsideSelectedObj()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 16. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 08. Nov. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
int SwFEShell::IsInsideSelectedObj( const Point &rPt )
|
|
|
|
|
{
|
|
|
|
|
if( Imp()->HasDrawView() )
|
|
|
|
|
{
|
|
|
|
|
SwDrawView *pDView = Imp()->GetDrawView();
|
|
|
|
|
|
2004-07-12 14:47:48 +00:00
|
|
|
|
if( pDView->GetMarkedObjectList().GetMarkCount() &&
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pDView->IsMarkedObjHit( rPt ) )
|
|
|
|
|
{
|
|
|
|
|
return SDRHIT_OBJECT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return SDRHIT_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::IsObjSelectable()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 16. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 02. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
bool SwFEShell::IsObjSelectable( const Point& rPt )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
SET_CURR_SHELL(this);
|
|
|
|
|
#ifdef OLD
|
|
|
|
|
if( Imp()->HasDrawView() )
|
|
|
|
|
return Imp()->GetDrawView()->PickSomething( rPt, MINMOVE );
|
|
|
|
|
return 0;
|
|
|
|
|
#else
|
|
|
|
|
SwDrawView *pDView = Imp()->GetDrawView();
|
2007-09-27 07:51:28 +00:00
|
|
|
|
bool bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( pDView )
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj;
|
|
|
|
|
SdrPageView* pPV;
|
|
|
|
|
USHORT nOld = pDView->GetHitTolerancePixel();
|
|
|
|
|
pDView->SetHitTolerancePixel( pDView->GetMarkHdlSizePixel()/2 );
|
|
|
|
|
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
bRet = 0 != pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pDView->SetHitTolerancePixel( nOld );
|
|
|
|
|
}
|
2007-09-27 07:51:28 +00:00
|
|
|
|
return bRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
|
// #107513#
|
|
|
|
|
// Test if there is a draw object at that position and if it should be selected.
|
|
|
|
|
// The 'should' is aimed at Writer text fly frames which may be in front of
|
|
|
|
|
// the draw object.
|
|
|
|
|
sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
|
|
|
|
|
{
|
|
|
|
|
SET_CURR_SHELL(this);
|
|
|
|
|
SwDrawView *pDrawView = Imp()->GetDrawView();
|
|
|
|
|
sal_Bool bRet(sal_False);
|
|
|
|
|
|
|
|
|
|
if(pDrawView)
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj;
|
|
|
|
|
SdrPageView* pPV;
|
|
|
|
|
sal_uInt16 nOld(pDrawView->GetHitTolerancePixel());
|
|
|
|
|
|
|
|
|
|
pDrawView->SetHitTolerancePixel(pDrawView->GetMarkHdlSizePixel()/2);
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
bRet = pDrawView->PickObj(rPt, pDrawView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE);
|
2003-03-27 14:45:43 +00:00
|
|
|
|
pDrawView->SetHitTolerancePixel(nOld);
|
|
|
|
|
|
|
|
|
|
if(bRet && pObj)
|
|
|
|
|
{
|
2008-03-18 14:56:59 +00:00
|
|
|
|
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
|
|
|
|
|
if( pObj->GetLayer() == pIDDMA->GetHellId() )
|
|
|
|
|
{
|
|
|
|
|
const SwFrm *pPageFrm = GetLayout()->Lower();
|
|
|
|
|
while( pPageFrm && !pPageFrm->Frm().IsInside( rPt ) )
|
|
|
|
|
{
|
|
|
|
|
if ( rPt.Y() < pPageFrm->Frm().Top() )
|
|
|
|
|
pPageFrm = 0;
|
|
|
|
|
else
|
|
|
|
|
pPageFrm = pPageFrm->GetNext();
|
|
|
|
|
}
|
|
|
|
|
if( pPageFrm )
|
|
|
|
|
{
|
|
|
|
|
SwRect aTmp( pPageFrm->Prt() );
|
|
|
|
|
aTmp += pPageFrm->Frm().Pos();
|
|
|
|
|
if( aTmp.IsInside( rPt ) )
|
|
|
|
|
return sal_False;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
2008-03-18 14:56:59 +00:00
|
|
|
|
const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0);
|
2005-07-08 10:02:18 +00:00
|
|
|
|
// --> FME 2005-04-18 #i20965# Use GetOrdNum() instead of GetOrdNumDirect()
|
|
|
|
|
// because ordnums might be wrong
|
|
|
|
|
for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++)
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
2005-07-08 10:02:18 +00:00
|
|
|
|
// <--
|
2003-03-27 14:45:43 +00:00
|
|
|
|
SdrObject *pCandidate = pPage->GetObj(a);
|
|
|
|
|
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if(pCandidate->ISA(SwVirtFlyDrawObj) && ((SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt))
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
bRet = sal_False;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
2002-04-09 09:18:06 +00:00
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2002-04-09 09:18:06 +00:00
|
|
|
|
|* SwFEShell::GotoObj()
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|*
|
2002-04-09 09:18:06 +00:00
|
|
|
|
|* Beschreibung Wenn ein Obj selektiert ist, gehen wir von dessen
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|* TopLeft aus, andernfalls von der Mitte des aktuellen CharRects.
|
2002-04-09 09:18:06 +00:00
|
|
|
|
|* Ersterstellung MA 01. Jun. 95
|
|
|
|
|
|* Letzte Aenderung MA 30. Apr. 96
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
2002-04-09 09:18:06 +00:00
|
|
|
|
/* -----------------23.09.98 10:29-------------------
|
|
|
|
|
* Beinhaltet das Objekt ein Control oder Gruppen,
|
|
|
|
|
* die nur aus Controls bestehen
|
|
|
|
|
* --------------------------------------------------*/
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL lcl_IsControlGroup( const SdrObject *pObj )
|
2002-04-09 09:18:06 +00:00
|
|
|
|
{
|
|
|
|
|
BOOL bRet = FALSE;
|
|
|
|
|
if(pObj->ISA(SdrUnoObj))
|
|
|
|
|
bRet = TRUE;
|
|
|
|
|
else if( pObj->ISA( SdrObjGroup ) )
|
|
|
|
|
{
|
|
|
|
|
bRet = TRUE;
|
|
|
|
|
const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
|
|
|
|
|
for ( USHORT i = 0; i < pLst->GetObjCount(); ++i )
|
|
|
|
|
if( !::lcl_IsControlGroup( pLst->GetObj( i ) ) )
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
if( !Imp()->HasDrawView() )
|
|
|
|
|
return FALSE;
|
|
|
|
|
else
|
|
|
|
|
{
|
2002-04-09 09:18:06 +00:00
|
|
|
|
const SdrObject *pBest = 0,
|
2000-09-18 23:08:29 +00:00
|
|
|
|
*pTop = 0;
|
|
|
|
|
|
|
|
|
|
const long nTmp = bNext ? LONG_MAX : 0;
|
|
|
|
|
Point aBestPos( nTmp, nTmp );
|
|
|
|
|
Point aTopPos( nTmp, nTmp );
|
|
|
|
|
Point aCurPos;
|
|
|
|
|
Point aPos;
|
|
|
|
|
BOOL bRet = FALSE;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL bNoDraw = 0 == (GOTOOBJ_DRAW_ANY & eType);
|
|
|
|
|
BOOL bNoFly = 0 == (GOTOOBJ_FLY_ANY & eType);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( !bNoFly && bNoDraw )
|
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = GetCurrFrm( FALSE )->FindFlyFrm();
|
|
|
|
|
if( pFly )
|
|
|
|
|
pBest = pFly->GetVirtDrawObj();
|
|
|
|
|
}
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2006-11-14 14:09:49 +00:00
|
|
|
|
SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
if( !pBest || rMrkList.GetMarkCount() == 1 )
|
|
|
|
|
{
|
|
|
|
|
// Ausgangspunkt bestimmen.
|
2002-11-07 06:57:51 +00:00
|
|
|
|
SdrObjList* pList = NULL;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if ( rMrkList.GetMarkCount() )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if( pStartObj->ISA(SwVirtFlyDrawObj) )
|
2002-11-07 06:57:51 +00:00
|
|
|
|
aPos = ((SwVirtFlyDrawObj*)pStartObj)->GetFlyFrm()->Frm().Pos();
|
2002-04-09 09:18:06 +00:00
|
|
|
|
else
|
2002-11-07 06:57:51 +00:00
|
|
|
|
aPos = pStartObj->GetSnapRect().TopLeft();
|
|
|
|
|
|
|
|
|
|
// If an object inside a group is selected, we want to
|
|
|
|
|
// iterate over the group members.
|
|
|
|
|
if ( ! pStartObj->GetUserCall() )
|
|
|
|
|
pList = pStartObj->GetObjList();
|
2002-04-09 09:18:06 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
2002-11-07 06:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
// If no object is selected, we check if we just entered a group.
|
|
|
|
|
// In this case we want to iterate over the group members.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
aPos = GetCharRect().Center();
|
2002-11-07 06:57:51 +00:00
|
|
|
|
const SdrObject* pStartObj = pPV ? pPV->GetAktGroup() : 0;
|
|
|
|
|
if ( pStartObj && pStartObj->ISA( SdrObjGroup ) )
|
|
|
|
|
pList = pStartObj->GetSubList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( ! pList )
|
|
|
|
|
{
|
|
|
|
|
// Here we are if
|
|
|
|
|
// A No object has been selected and no group has been entered or
|
|
|
|
|
// B An object has been selected and it is not inside a group
|
2006-08-14 15:15:42 +00:00
|
|
|
|
pList = getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
|
2002-11-07 06:57:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT( pList, "No object list to iterate" )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2002-11-07 06:57:51 +00:00
|
|
|
|
const ULONG nObjs = pList->GetObjCount();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for( ULONG nObj = 0; nObj < nObjs; ++nObj )
|
|
|
|
|
{
|
2002-11-07 06:57:51 +00:00
|
|
|
|
SdrObject* pObj = pList->GetObj( nObj );
|
2003-11-24 15:03:25 +00:00
|
|
|
|
BOOL bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( ( bNoFly && bFlyFrm ) ||
|
|
|
|
|
( bNoDraw && !bFlyFrm ) ||
|
2007-09-27 07:51:28 +00:00
|
|
|
|
( eType == GOTOOBJ_DRAW_SIMPLE && lcl_IsControlGroup( pObj ) ) ||
|
|
|
|
|
( eType == GOTOOBJ_DRAW_CONTROL && !lcl_IsControlGroup( pObj ) ) ||
|
2002-11-15 09:56:32 +00:00
|
|
|
|
( pPV && ! pPV->GetView().IsObjMarkable( pObj, pPV ) ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
continue;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( bFlyFrm )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2002-04-09 09:18:06 +00:00
|
|
|
|
SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pObj;
|
|
|
|
|
SwFlyFrm *pFly = pO->GetFlyFrm();
|
2007-09-27 07:51:28 +00:00
|
|
|
|
if( GOTOOBJ_FLY_ANY != ( GOTOOBJ_FLY_ANY & eType ) )
|
2002-04-09 09:18:06 +00:00
|
|
|
|
{
|
|
|
|
|
switch ( eType )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
case GOTOOBJ_FLY_FRM:
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
|
|
|
|
|
continue;
|
|
|
|
|
break;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
case GOTOOBJ_FLY_GRF:
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if ( pFly->Lower() &&
|
|
|
|
|
(pFly->Lower()->IsLayoutFrm() ||
|
|
|
|
|
!((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode()))
|
|
|
|
|
continue;
|
|
|
|
|
break;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
case GOTOOBJ_FLY_OLE:
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if ( pFly->Lower() &&
|
|
|
|
|
(pFly->Lower()->IsLayoutFrm() ||
|
|
|
|
|
!((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode()))
|
|
|
|
|
continue;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
aCurPos = pFly->Frm().Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
2002-04-09 09:18:06 +00:00
|
|
|
|
else
|
2003-11-24 15:03:25 +00:00
|
|
|
|
aCurPos = pObj->GetCurrentBoundRect().TopLeft();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
// Sonderfall wenn ein anderes Obj auf selber Y steht.
|
|
|
|
|
if( aCurPos != aPos && // nur wenn ich es nicht selber bin
|
|
|
|
|
aCurPos.Y() == aPos.Y() && // ist die Y Position gleich
|
|
|
|
|
(bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
|
|
|
|
|
(aCurPos.X() < aPos.X())) ) // " reverse
|
|
|
|
|
{
|
|
|
|
|
aBestPos = Point( nTmp, nTmp );
|
|
|
|
|
for( ULONG i = 0; i < nObjs; ++i )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SdrObject *pTmpObj = pList->GetObj( i );
|
|
|
|
|
bFlyFrm = pTmpObj->ISA(SwVirtFlyDrawObj);
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( ( bNoFly && bFlyFrm ) || ( bNoDraw && !bFlyFrm ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
continue;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( bFlyFrm )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pTmpObj;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
aCurPos = pO->GetFlyFrm()->Frm().Pos();
|
|
|
|
|
}
|
|
|
|
|
else
|
2007-09-27 07:51:28 +00:00
|
|
|
|
aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
|
|
|
|
|
(bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
|
|
|
|
|
(aCurPos.X() < aPos.X())) && // " reverse
|
|
|
|
|
(bNext? (aCurPos.X() < aBestPos.X()) : // besser als Beste
|
|
|
|
|
(aCurPos.X() > aBestPos.X())) ) // " reverse
|
|
|
|
|
{
|
|
|
|
|
aBestPos = aCurPos;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
pBest = pTmpObj;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( (bNext? (aPos.Y() < aCurPos.Y()) : // nur unter mir
|
|
|
|
|
(aPos.Y() > aCurPos.Y())) && // " reverse
|
|
|
|
|
(bNext? (aBestPos.Y() > aCurPos.Y()) : // naeher drunter
|
|
|
|
|
(aBestPos.Y() < aCurPos.Y())) || // " reverse
|
|
|
|
|
(aBestPos.Y() == aCurPos.Y() &&
|
|
|
|
|
(bNext? (aBestPos.X() > aCurPos.X()) : // weiter links
|
|
|
|
|
(aBestPos.X() < aCurPos.X())))) // " reverse
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
aBestPos = aCurPos;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
pBest = pObj;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( (bNext? (aTopPos.Y() > aCurPos.Y()) : // hoeher als Beste
|
|
|
|
|
(aTopPos.Y() < aCurPos.Y())) || // " reverse
|
|
|
|
|
(aTopPos.Y() == aCurPos.Y() &&
|
|
|
|
|
(bNext? (aTopPos.X() > aCurPos.X()) : // weiter links
|
|
|
|
|
(aTopPos.X() < aCurPos.X())))) // " reverse
|
|
|
|
|
{
|
|
|
|
|
aTopPos = aCurPos;
|
2002-04-09 09:18:06 +00:00
|
|
|
|
pTop = pObj;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// leider nichts gefunden
|
|
|
|
|
if( (bNext? (aBestPos.X() == LONG_MAX) : (aBestPos.X() == 0)) )
|
|
|
|
|
pBest = pTop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( pBest )
|
|
|
|
|
{
|
2003-11-24 15:03:25 +00:00
|
|
|
|
BOOL bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( bFlyFrm )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2002-04-09 09:18:06 +00:00
|
|
|
|
SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
|
|
|
|
|
const SwRect& rFrm = pO->GetFlyFrm()->Frm();
|
2002-04-09 13:21:41 +00:00
|
|
|
|
SelectObj( rFrm.Pos(), 0, (SdrObject*)pBest );
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( !ActionPend() )
|
|
|
|
|
MakeVisible( rFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
2002-04-09 09:18:06 +00:00
|
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2002-04-09 13:21:41 +00:00
|
|
|
|
SelectObj( Point(), 0, (SdrObject*)pBest );
|
2002-04-09 09:18:06 +00:00
|
|
|
|
if( !ActionPend() )
|
2003-11-24 15:03:25 +00:00
|
|
|
|
MakeVisible( pBest->GetCurrentBoundRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
CallChgLnk();
|
|
|
|
|
bRet = TRUE;
|
|
|
|
|
}
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BeginCreate()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 21. Mar. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
BOOL bRet = FALSE;
|
|
|
|
|
|
|
|
|
|
if ( !Imp()->HasDrawView() )
|
|
|
|
|
Imp()->MakeDrawView();
|
|
|
|
|
|
|
|
|
|
if ( GetPageNumber( rPos ) )
|
|
|
|
|
{
|
|
|
|
|
Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind );
|
|
|
|
|
if ( eSdrObjectKind == OBJ_CAPTION )
|
|
|
|
|
bRet = Imp()->GetDrawView()->BegCreateCaptionObj(
|
|
|
|
|
rPos, Size( lMinBorder - MINFLY, lMinBorder - MINFLY ),
|
|
|
|
|
GetOut() );
|
|
|
|
|
else
|
|
|
|
|
bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
|
|
|
|
|
}
|
|
|
|
|
if ( bRet )
|
2002-06-24 13:53:54 +00:00
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
|
::FrameNotify( this, FLY_DRAG_START );
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, UINT32 eObjInventor,
|
2000-09-18 23:08:29 +00:00
|
|
|
|
const Point &rPos )
|
|
|
|
|
{
|
|
|
|
|
BOOL bRet = FALSE;
|
|
|
|
|
|
|
|
|
|
if ( !Imp()->HasDrawView() )
|
|
|
|
|
Imp()->MakeDrawView();
|
|
|
|
|
|
|
|
|
|
if ( GetPageNumber( rPos ) )
|
|
|
|
|
{
|
|
|
|
|
Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind, eObjInventor );
|
|
|
|
|
bRet = Imp()->GetDrawView()->BegCreateObj( rPos, GetOut() );
|
|
|
|
|
}
|
|
|
|
|
if ( bRet )
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_START );
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::MoveCreate()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 24. Jan. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::MoveCreate( const Point &rPos )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "MoveCreate without DrawView?" );
|
|
|
|
|
if ( GetPageNumber( rPos ) )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
ScrollTo( rPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Imp()->GetDrawView()->MovCreateObj( rPos );
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::EndCreate(), ImpEndCreate()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 14. Oct. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::EndCreate( UINT16 eSdrCreateCmd )
|
|
|
|
|
{
|
|
|
|
|
// JP 18.08.95: Damit das Undo-Object aus der DrawEngine nicht bei uns
|
|
|
|
|
// gespeichert wird, (wir erzeugen ein eigenes Undo-Object!) hier kurz
|
|
|
|
|
// das Undo abschalten
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "EndCreate without DrawView?" );
|
|
|
|
|
if( !Imp()->GetDrawView()->IsGroupEntered() )
|
|
|
|
|
GetDoc()->SetNoDrawUndoObj( TRUE );
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL bCreate = Imp()->GetDrawView()->EndCreateObj(
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SdrCreateCmd( eSdrCreateCmd ) );
|
|
|
|
|
GetDoc()->SetNoDrawUndoObj( FALSE );
|
|
|
|
|
|
|
|
|
|
if ( !bCreate )
|
|
|
|
|
{
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_END );
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( (SdrCreateCmd)eSdrCreateCmd == SDRCREATE_NEXTPOINT )
|
|
|
|
|
{
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
return ImpEndCreate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::ImpEndCreate()
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
ASSERT( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1,
|
2000-09-18 23:08:29 +00:00
|
|
|
|
"Neues Object nicht selektiert." );
|
|
|
|
|
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject& rSdrObj = *Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
if( rSdrObj.GetSnapRect().IsEmpty() )
|
|
|
|
|
{
|
|
|
|
|
//JP 10.04.95: das Object vergessen wir lieber, fuerht nur
|
|
|
|
|
// zu Problemen
|
|
|
|
|
Imp()->GetDrawView()->DeleteMarked();
|
|
|
|
|
Imp()->GetDrawView()->UnmarkAll();
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_END );
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( rSdrObj.GetUpGroup() )
|
|
|
|
|
{
|
2004-06-28 12:34:54 +00:00
|
|
|
|
Point aTmpPos( rSdrObj.GetSnapRect().TopLeft() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Point aNewAnchor( rSdrObj.GetUpGroup()->GetAnchorPos() );
|
2004-06-28 12:34:54 +00:00
|
|
|
|
// OD 2004-04-05 #i26791# - direct object positioning for group members
|
2000-09-18 23:08:29 +00:00
|
|
|
|
rSdrObj.NbcSetRelativePos( aTmpPos - aNewAnchor );
|
|
|
|
|
rSdrObj.NbcSetAnchorPos( aNewAnchor );
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-18 09:49:51 +00:00
|
|
|
|
LockPaint();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
StartAllAction();
|
|
|
|
|
|
|
|
|
|
Imp()->GetDrawView()->UnmarkAll();
|
|
|
|
|
|
|
|
|
|
const Rectangle &rBound = rSdrObj.GetSnapRect();
|
2002-09-17 07:14:21 +00:00
|
|
|
|
Point aPt( rBound.TopRight() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
//Fremde Identifier sollen in den Default laufen.
|
|
|
|
|
//Ueberschneidungen sind moeglich!!
|
|
|
|
|
UINT16 nIdent = SdrInventor == rSdrObj.GetObjInventor()
|
|
|
|
|
? rSdrObj.GetObjIdentifier()
|
|
|
|
|
: 0xFFFF;
|
|
|
|
|
|
|
|
|
|
//Default fuer Controls ist Zeichengebunden, Absatzgebunden sonst.
|
|
|
|
|
SwFmtAnchor aAnch;
|
|
|
|
|
const SwFrm *pAnch = 0;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL bCharBound = FALSE;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( rSdrObj.ISA( SdrUnoObj ) )
|
|
|
|
|
{
|
|
|
|
|
SwPosition aPos( GetDoc()->GetNodes() );
|
|
|
|
|
SwCrsrMoveState aState( MV_SETONLYTEXT );
|
|
|
|
|
Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 );
|
2006-08-14 15:15:42 +00:00
|
|
|
|
getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
//JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
|
|
|
|
|
if( !aPos.nNode.GetNode().IsProtect() )
|
|
|
|
|
{
|
|
|
|
|
pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, &aPos );
|
|
|
|
|
SwRect aTmp;
|
|
|
|
|
pAnch->GetCharRect( aTmp, aPos );
|
|
|
|
|
|
|
|
|
|
//Der Crsr darf nicht zu weit entfernt sein.
|
|
|
|
|
bCharBound = TRUE;
|
|
|
|
|
Rectangle aRect( aTmp.SVRect() );
|
|
|
|
|
aRect.Left() -= MM50*2;
|
|
|
|
|
aRect.Top() -= MM50*2;
|
|
|
|
|
aRect.Right() += MM50*2;
|
|
|
|
|
aRect.Bottom()+= MM50*2;
|
|
|
|
|
|
|
|
|
|
if( !aRect.IsOver( rBound ) && !::GetHtmlMode( GetDoc()->GetDocShell() ))
|
|
|
|
|
bCharBound = FALSE;
|
|
|
|
|
|
|
|
|
|
//Bindung in Kopf-/Fusszeilen ist ebenfalls nicht erlaubt.
|
|
|
|
|
if( bCharBound )
|
|
|
|
|
bCharBound = !GetDoc()->IsInHeaderFooter( aPos.nNode );
|
|
|
|
|
|
|
|
|
|
if( bCharBound )
|
|
|
|
|
{
|
|
|
|
|
aAnch.SetType( FLY_IN_CNTNT );
|
|
|
|
|
aAnch.SetAnchor( &aPos );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !bCharBound )
|
|
|
|
|
{
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 16.05.2003 #108784# - allow native drawing objects in header/footer.
|
|
|
|
|
// Thus, set <bBodyOnly> to <false> for these objects using value
|
|
|
|
|
// of <nIdent> - value <0xFFFF> indicates control objects, which aren't
|
|
|
|
|
// allowed in header/footer.
|
|
|
|
|
//bool bBodyOnly = OBJ_NONE != nIdent;
|
|
|
|
|
bool bBodyOnly = 0xFFFF == nIdent;
|
|
|
|
|
bool bAtPage = false;
|
|
|
|
|
const SwFrm* pPage = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwCrsrMoveState aState( MV_SETONLYTEXT );
|
|
|
|
|
Point aPoint( aPt );
|
|
|
|
|
SwPosition aPos( GetDoc()->GetNodes() );
|
|
|
|
|
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
|
|
|
|
|
|
|
|
|
|
//JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
|
|
|
|
|
if( aPos.nNode.GetNode().IsProtect() )
|
|
|
|
|
// dann darf er nur seitengebunden sein. Oder sollte man
|
|
|
|
|
// die naechste nicht READONLY Position suchen?
|
2003-07-04 12:20:40 +00:00
|
|
|
|
bAtPage = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, FALSE );
|
|
|
|
|
|
|
|
|
|
if( !bAtPage )
|
|
|
|
|
{
|
|
|
|
|
const SwFlyFrm *pTmp = pAnch->FindFlyFrm();
|
|
|
|
|
if( pTmp )
|
|
|
|
|
{
|
|
|
|
|
const SwFrm* pTmpFrm = pAnch;
|
|
|
|
|
SwRect aBound( rBound );
|
|
|
|
|
while( pTmp )
|
|
|
|
|
{
|
|
|
|
|
if( pTmp->Frm().IsInside( aBound ) )
|
|
|
|
|
{
|
|
|
|
|
if( !bBodyOnly || !pTmp->FindFooterOrHeader() )
|
|
|
|
|
pPage = pTmpFrm;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pTmp = pTmp->GetAnchorFrm()
|
|
|
|
|
? pTmp->GetAnchorFrm()->FindFlyFrm()
|
2000-09-18 23:08:29 +00:00
|
|
|
|
: 0;
|
|
|
|
|
pTmpFrm = pTmp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !pPage )
|
|
|
|
|
pPage = pAnch->FindPageFrm();
|
|
|
|
|
|
|
|
|
|
// immer ueber FindAnchor gehen, damit der Frame immer an den
|
|
|
|
|
// davorgehen gebunden wird. Beim GetCrsOfst kann man auch zum
|
|
|
|
|
// nachfolgenden kommen. DAS IST FALSCH
|
|
|
|
|
pAnch = ::FindAnchor( pPage, aPt, bBodyOnly );
|
|
|
|
|
aPos.nNode = *((SwCntntFrm*)pAnch)->GetNode();
|
|
|
|
|
|
|
|
|
|
//JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
|
|
|
|
|
if( aPos.nNode.GetNode().IsProtect() )
|
|
|
|
|
// dann darf er nur seitengebunden sein. Oder sollte man
|
|
|
|
|
// die naechste nicht READONLY Position suchen?
|
2003-07-04 12:20:40 +00:00
|
|
|
|
bAtPage = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aAnch.SetType( FLY_AT_CNTNT );
|
|
|
|
|
aAnch.SetAnchor( &aPos );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bAtPage )
|
|
|
|
|
{
|
|
|
|
|
pPage = pAnch->FindPageFrm();
|
|
|
|
|
|
|
|
|
|
aAnch.SetType( FLY_PAGE );
|
|
|
|
|
aAnch.SetPageNum( pPage->GetPhyPageNum() );
|
|
|
|
|
pAnch = pPage; // die Page wird jetzt zum Anker
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SfxItemSet aSet( GetDoc()->GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE,
|
|
|
|
|
RES_SURROUND, RES_ANCHOR, 0 );
|
|
|
|
|
aSet.Put( aAnch );
|
|
|
|
|
|
2004-06-28 12:34:54 +00:00
|
|
|
|
// OD 2004-03-30 #i26791# - determine relative object position
|
|
|
|
|
SwTwips nXOffset;
|
|
|
|
|
SwTwips nYOffset = rBound.Top() - pAnch->Frm().Top();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
if( pAnch->IsVertical() )
|
2002-09-16 13:35:23 +00:00
|
|
|
|
{
|
|
|
|
|
nXOffset = nYOffset;
|
|
|
|
|
nYOffset = pAnch->Frm().Left()+pAnch->Frm().Width()-rBound.Right();
|
|
|
|
|
}
|
|
|
|
|
else if( pAnch->IsRightToLeft() )
|
|
|
|
|
nXOffset = pAnch->Frm().Left()+pAnch->Frm().Width()-rBound.Right();
|
|
|
|
|
else
|
|
|
|
|
nXOffset = rBound.Left() - pAnch->Frm().Left();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
|
|
|
|
|
{
|
|
|
|
|
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
|
|
|
|
|
do {
|
|
|
|
|
pTmp = pTmp->FindMaster();
|
|
|
|
|
ASSERT( pTmp, "Where's my Master?" );
|
2004-06-28 12:34:54 +00:00
|
|
|
|
// OD 2004-03-30 #i26791# - correction: add frame area height
|
|
|
|
|
// of master frames.
|
2002-09-16 13:35:23 +00:00
|
|
|
|
nYOffset += pTmp->IsVertical() ?
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pTmp->Frm().Width() : pTmp->Frm().Height();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
} while ( pTmp->IsFollow() );
|
|
|
|
|
}
|
2004-06-28 12:34:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( OBJ_NONE == nIdent )
|
|
|
|
|
{
|
|
|
|
|
//Bei OBJ_NONE wird ein Fly eingefuegt.
|
|
|
|
|
const long nWidth = rBound.Right() - rBound.Left();
|
|
|
|
|
const long nHeight= rBound.Bottom() - rBound.Top();
|
|
|
|
|
aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, Max( nWidth, long(MINFLY) ),
|
|
|
|
|
Max( nHeight, long(MINFLY) )));
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwFmtHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
|
|
|
|
|
SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
aSet.Put( SwFmtSurround( SURROUND_PARALLEL ) );
|
|
|
|
|
aSet.Put( aHori );
|
|
|
|
|
aSet.Put( aVert );
|
|
|
|
|
|
|
|
|
|
//Schnell noch das Rechteck merken
|
|
|
|
|
const SwRect aFlyRect( rBound );
|
|
|
|
|
|
|
|
|
|
//Erzeugtes Object wegwerfen, so kann der Fly am elegentesten
|
|
|
|
|
//ueber vorhandene SS erzeugt werden.
|
|
|
|
|
GetDoc()->SetNoDrawUndoObj( TRUE ); // siehe oben
|
2005-09-28 10:07:01 +00:00
|
|
|
|
// --> OD 2005-08-08 #i52858# - method name changed
|
2006-08-14 15:15:42 +00:00
|
|
|
|
SdrPage *pPg = getIDocumentDrawModelAccess()->GetOrCreateDrawModel()->GetPage( 0 );
|
2005-09-28 10:07:01 +00:00
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( !pPg )
|
|
|
|
|
{
|
2006-08-14 15:15:42 +00:00
|
|
|
|
SdrModel* pTmpSdrModel = getIDocumentDrawModelAccess()->GetDrawModel();
|
|
|
|
|
pPg = pTmpSdrModel->AllocPage( FALSE );
|
|
|
|
|
pTmpSdrModel->InsertPage( pPg );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
pPg->RecalcObjOrdNums();
|
2007-07-06 08:52:22 +00:00
|
|
|
|
SdrObject* pRemovedObject = pPg->RemoveObject( rSdrObj.GetOrdNumDirect() );
|
|
|
|
|
SdrObject::Free( pRemovedObject );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
GetDoc()->SetNoDrawUndoObj( FALSE );
|
|
|
|
|
|
|
|
|
|
SwFlyFrm* pFlyFrm;
|
|
|
|
|
if( NewFlyFrm( aSet, TRUE ) &&
|
|
|
|
|
::GetHtmlMode( GetDoc()->GetDocShell() ) &&
|
|
|
|
|
0 != ( pFlyFrm = FindFlyFrm() ))
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), RES_VERT_ORIENT, RES_HORI_ORIENT );
|
|
|
|
|
//Horizontale Ausrichtung:
|
2007-09-27 07:51:28 +00:00
|
|
|
|
const BOOL bLeftFrm = aFlyRect.Left() <
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pAnch->Frm().Left() + pAnch->Prt().Left(),
|
|
|
|
|
bLeftPrt = aFlyRect.Left() + aFlyRect.Width() <
|
|
|
|
|
pAnch->Frm().Left() + pAnch->Prt().Width()/2;
|
|
|
|
|
if( bLeftFrm || bLeftPrt )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
aHori.SetHoriOrient( text::HoriOrientation::LEFT );
|
|
|
|
|
aHori.SetRelationOrient( bLeftFrm ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
const BOOL bRightFrm = aFlyRect.Left() >
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pAnch->Frm().Left() + pAnch->Prt().Width();
|
2007-09-27 07:51:28 +00:00
|
|
|
|
aHori.SetHoriOrient( text::HoriOrientation::RIGHT );
|
|
|
|
|
aHori.SetRelationOrient( bRightFrm ? text::RelOrientation::FRAME : text::RelOrientation::PRINT_AREA );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
aHtmlSet.Put( aHori );
|
2007-09-27 07:51:28 +00:00
|
|
|
|
aVert.SetVertOrient( text::VertOrientation::TOP );
|
|
|
|
|
aVert.SetRelationOrient( text::RelOrientation::PRINT_AREA );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
aHtmlSet.Put( aVert );
|
|
|
|
|
|
|
|
|
|
GetDoc()->SetAttr( aHtmlSet, *pFlyFrm->GetFmt() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Point aRelNullPt;
|
|
|
|
|
if( OBJ_CAPTION == nIdent )
|
|
|
|
|
aRelNullPt = ((SdrCaptionObj&)rSdrObj).GetTailPos();
|
|
|
|
|
else
|
|
|
|
|
aRelNullPt = rBound.TopLeft();
|
|
|
|
|
|
|
|
|
|
aSet.Put( aAnch );
|
|
|
|
|
aSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
|
2004-06-28 12:34:54 +00:00
|
|
|
|
// OD 2004-03-30 #i26791# - set horizontal position
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwFmtHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
|
2004-06-28 12:34:54 +00:00
|
|
|
|
aSet.Put( aHori );
|
|
|
|
|
// OD 2004-03-30 #i26791# - set vertical position
|
|
|
|
|
if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
|
|
|
|
|
{
|
|
|
|
|
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
|
|
|
|
|
do {
|
|
|
|
|
pTmp = pTmp->FindMaster();
|
|
|
|
|
ASSERT( pTmp, "Where's my Master?" );
|
|
|
|
|
nYOffset += pTmp->IsVertical() ?
|
|
|
|
|
pTmp->Prt().Width() : pTmp->Prt().Height();
|
|
|
|
|
} while ( pTmp->IsFollow() );
|
|
|
|
|
}
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
|
2004-06-28 12:34:54 +00:00
|
|
|
|
aSet.Put( aVert );
|
2006-08-14 15:15:42 +00:00
|
|
|
|
SwDrawFrmFmt* pFmt = (SwDrawFrmFmt*)getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
|
2004-10-27 11:31:09 +00:00
|
|
|
|
// --> OD 2004-10-25 #i36010# - set layout direction of the position
|
|
|
|
|
pFmt->SetPositionLayoutDir(
|
2007-09-27 07:51:28 +00:00
|
|
|
|
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
|
2004-10-27 11:31:09 +00:00
|
|
|
|
// <--
|
2005-03-23 11:57:11 +00:00
|
|
|
|
// --> OD 2005-03-11 #i44344#, #i44681# - positioning attributes already set
|
|
|
|
|
pFmt->PosAttrSet();
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
SwDrawContact *pContact = new SwDrawContact( pFmt, &rSdrObj );
|
2004-12-23 09:05:11 +00:00
|
|
|
|
// --> OD 2004-11-22 #i35635#
|
|
|
|
|
pContact->MoveObjToVisibleLayer( &rSdrObj );
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( bCharBound )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( aAnch.GetAnchorId() == FLY_IN_CNTNT, "wrong AnchorType" );
|
|
|
|
|
SwTxtNode *pNd = aAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
|
CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 14:29:45 +00:00
|
|
|
|
SwFmtFlyCnt aFmt( pFmt );
|
|
|
|
|
pNd->InsertItem(aFmt,
|
2000-09-18 23:08:29 +00:00
|
|
|
|
aAnch.GetCntntAnchor()->nContent.GetIndex(), 0 );
|
2007-09-27 07:51:28 +00:00
|
|
|
|
SwFmtVertOrient aVertical( pFmt->GetVertOrient() );
|
|
|
|
|
aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
|
2008-06-13 08:47:50 +00:00
|
|
|
|
pFmt->SetFmtAttr( aVertical );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
|
|
|
|
|
{
|
|
|
|
|
SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
|
|
|
|
|
do {
|
|
|
|
|
pTmp = pTmp->FindMaster();
|
|
|
|
|
ASSERT( pTmp, "Where's my Master?" );
|
|
|
|
|
} while( pTmp->IsFollow() );
|
|
|
|
|
pAnch = pTmp;
|
|
|
|
|
}
|
2003-05-22 08:44:39 +00:00
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pContact->ConnectToLayout();
|
|
|
|
|
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 25.06.2003 #108784# - mark object at frame the object is inserted at.
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pMarkObj = pContact->GetDrawObjectByAnchorFrm( *pAnch );
|
|
|
|
|
if ( pMarkObj )
|
|
|
|
|
{
|
|
|
|
|
Imp()->GetDrawView()->MarkObj( pMarkObj, Imp()->GetPageView(),
|
|
|
|
|
FALSE, FALSE );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Imp()->GetDrawView()->MarkObj( &rSdrObj, Imp()->GetPageView(),
|
|
|
|
|
FALSE, FALSE );
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
|
|
|
|
|
KillPams();
|
|
|
|
|
EndAllActionAndCall();
|
2008-08-18 09:49:51 +00:00
|
|
|
|
UnlockPaint();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BreakCreate()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 20. Dec. 94
|
|
|
|
|
|* Letzte Aenderung MA 09. Jan. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::BreakCreate()
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "BreakCreate without DrawView?" );
|
|
|
|
|
Imp()->GetDrawView()->BrkCreateObj();
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_END );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::IsDrawCreate()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 16. Mar. 95
|
|
|
|
|
|* Letzte Aenderung OM 16. Mar. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::IsDrawCreate() const
|
|
|
|
|
{
|
|
|
|
|
return Imp()->HasDrawView() ? Imp()->GetDrawView()->IsCreateObj() : FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BeginMark()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 07. Feb. 95
|
|
|
|
|
|* Letzte Aenderung OM 07. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::BeginMark( const Point &rPos )
|
|
|
|
|
{
|
|
|
|
|
if ( !Imp()->HasDrawView() )
|
|
|
|
|
Imp()->MakeDrawView();
|
|
|
|
|
|
|
|
|
|
if ( GetPageNumber( rPos ) )
|
|
|
|
|
{
|
|
|
|
|
SwDrawView* pDView = Imp()->GetDrawView();
|
|
|
|
|
|
|
|
|
|
if (pDView->HasMarkablePoints())
|
2006-11-14 14:09:49 +00:00
|
|
|
|
return pDView->BegMarkPoints( rPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
2006-11-14 14:09:49 +00:00
|
|
|
|
return pDView->BegMarkObj( rPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::MoveMark()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 07. Feb. 95
|
|
|
|
|
|* Letzte Aenderung OM 07. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::MoveMark( const Point &rPos )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "MoveMark without DrawView?" );
|
|
|
|
|
|
|
|
|
|
if ( GetPageNumber( rPos ) )
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
ScrollTo( rPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwDrawView* pDView = Imp()->GetDrawView();
|
|
|
|
|
// Imp()->GetDrawView()->MovMarkObj( rPos );
|
|
|
|
|
|
|
|
|
|
if (pDView->IsInsObjPoint())
|
|
|
|
|
pDView->MovInsObjPoint( rPos );
|
|
|
|
|
else if (pDView->IsMarkPoints())
|
|
|
|
|
pDView->MovMarkPoints( rPos );
|
|
|
|
|
else
|
|
|
|
|
pDView->MovAction( rPos );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::EndMark()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 07. Feb. 95
|
|
|
|
|
|* Letzte Aenderung MA 08. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::EndMark()
|
|
|
|
|
{
|
|
|
|
|
BOOL bRet = FALSE;
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "EndMark without DrawView?" );
|
|
|
|
|
|
|
|
|
|
if (Imp()->GetDrawView()->IsMarkObj())
|
|
|
|
|
{
|
|
|
|
|
bRet = Imp()->GetDrawView()->EndMarkObj();
|
|
|
|
|
|
|
|
|
|
if ( bRet )
|
|
|
|
|
{
|
|
|
|
|
BOOL bShowHdl = FALSE;
|
|
|
|
|
SwDrawView* pDView = Imp()->GetDrawView();
|
|
|
|
|
//Rahmen werden auf diese Art nicht Selektiert, es sein denn es
|
|
|
|
|
//ist nur ein Rahmen.
|
2004-07-12 14:47:48 +00:00
|
|
|
|
SdrMarkList &rMrkList = (SdrMarkList&)pDView->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwFlyFrm* pOldSelFly = ::GetFlyFromMarked( &rMrkList, this );
|
|
|
|
|
|
|
|
|
|
if ( rMrkList.GetMarkCount() > 1 )
|
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if( pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
if ( !bShowHdl )
|
|
|
|
|
{
|
2006-12-12 15:27:27 +00:00
|
|
|
|
//HMHpDView->HideMarkHdl();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
bShowHdl = TRUE;
|
|
|
|
|
}
|
2004-07-12 14:47:48 +00:00
|
|
|
|
rMrkList.DeleteMark( i );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
--i; //keinen auslassen.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bShowHdl )
|
|
|
|
|
{
|
|
|
|
|
pDView->MarkListHasChanged();
|
|
|
|
|
pDView->AdjustMarkHdl();
|
2006-12-12 15:27:27 +00:00
|
|
|
|
//HMHpDView->ShowMarkHdl();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( rMrkList.GetMarkCount() )
|
|
|
|
|
::lcl_GrabCursor(this, pOldSelFly);
|
|
|
|
|
else
|
|
|
|
|
bRet = FALSE;
|
|
|
|
|
}
|
|
|
|
|
if ( bRet )
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_START );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Imp()->GetDrawView()->IsMarkPoints())
|
|
|
|
|
bRet = Imp()->GetDrawView()->EndMarkPoints();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetChainMarker();
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::BreakSelect()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung OM 07. Feb. 95
|
|
|
|
|
|* Letzte Aenderung OM 07. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::BreakMark()
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "BreakMark without DrawView?" );
|
|
|
|
|
Imp()->GetDrawView()->BrkMarkObj();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::GetAnchorId()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 30. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 30. Jan. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
short SwFEShell::GetAnchorId() const
|
|
|
|
|
{
|
|
|
|
|
short nRet = SHRT_MAX;
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if ( pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
nRet = -1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
|
2007-09-27 07:51:28 +00:00
|
|
|
|
short nId = static_cast<short>(pContact->GetFmt()->GetAnchor().GetAnchorId());
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( nRet == SHRT_MAX )
|
|
|
|
|
nRet = nId;
|
|
|
|
|
else if ( nRet != nId )
|
|
|
|
|
{
|
|
|
|
|
nRet = -1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( nRet == SHRT_MAX )
|
|
|
|
|
nRet = -1;
|
|
|
|
|
return nRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::ChgAnchor()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 10. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 30. May. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "ChgAnchor without DrawView?" );
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( rMrkList.GetMarkCount() &&
|
2006-07-25 11:33:25 +00:00
|
|
|
|
!rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
|
2004-06-28 12:34:54 +00:00
|
|
|
|
if( GetDoc()->ChgAnchor( rMrkList, (RndStdIds)eAnchorId, bSameOnly, bPosCorr ))
|
2000-09-18 23:08:29 +00:00
|
|
|
|
Imp()->GetDrawView()->UnmarkAll();
|
|
|
|
|
|
|
|
|
|
EndAllAction();
|
|
|
|
|
|
|
|
|
|
::FrameNotify( this, FLY_DRAG );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::DelSelectedObj()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 03. Nov. 92
|
|
|
|
|
|* Letzte Aenderung MA 14. Nov. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::DelSelectedObj()
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->HasDrawView(), "DelSelectedObj(), no DrawView available" );
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
Imp()->GetDrawView()->DeleteMarked();
|
|
|
|
|
EndAllAction();
|
|
|
|
|
::FrameNotify( this, FLY_DRAG_END );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::GetObjSize(), GetAnchorObjDiff()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Fuer die Statuszeile zum Erfragen der aktuellen
|
|
|
|
|
|* Verhaeltnisse
|
|
|
|
|
|* Ersterstellung MA 25. Apr. 95
|
|
|
|
|
|* Letzte Aenderung MA 25. Apr. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
Size SwFEShell::GetObjSize() const
|
|
|
|
|
{
|
|
|
|
|
Rectangle aRect;
|
|
|
|
|
if ( Imp()->HasDrawView() )
|
|
|
|
|
{
|
|
|
|
|
if ( Imp()->GetDrawView()->IsAction() )
|
|
|
|
|
Imp()->GetDrawView()->TakeActionRect( aRect );
|
|
|
|
|
else
|
|
|
|
|
aRect = Imp()->GetDrawView()->GetAllMarkedRect();
|
|
|
|
|
}
|
|
|
|
|
return aRect.GetSize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Point SwFEShell::GetAnchorObjDiff() const
|
|
|
|
|
{
|
|
|
|
|
const SdrView *pView = Imp()->GetDrawView();
|
|
|
|
|
ASSERT( pView, "GetAnchorObjDiff without DrawView?" );
|
|
|
|
|
|
|
|
|
|
Rectangle aRect;
|
|
|
|
|
if ( Imp()->GetDrawView()->IsAction() )
|
|
|
|
|
Imp()->GetDrawView()->TakeActionRect( aRect );
|
|
|
|
|
else
|
|
|
|
|
aRect = Imp()->GetDrawView()->GetAllMarkedRect();
|
|
|
|
|
|
|
|
|
|
Point aRet( aRect.TopLeft() );
|
|
|
|
|
|
|
|
|
|
if ( IsFrmSelected() )
|
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = FindFlyFrm();
|
2004-06-28 12:34:54 +00:00
|
|
|
|
aRet -= pFly->GetAnchorFrm()->Frm().Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrObject *pObj = pView->GetMarkedObjectList().GetMarkCount() == 1 ?
|
2006-07-25 11:33:25 +00:00
|
|
|
|
pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( pObj )
|
|
|
|
|
aRet -= pObj->GetAnchorPos();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return aRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Point SwFEShell::GetObjAbsPos() const
|
|
|
|
|
{
|
|
|
|
|
ASSERT( Imp()->GetDrawView(), "GetObjAbsPos() without DrawView?" );
|
|
|
|
|
return Imp()->GetDrawView()->GetDragStat().GetActionRect().TopLeft();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::IsGroupSelected()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 30. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 30. May. 96
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::IsGroupSelected()
|
|
|
|
|
{
|
|
|
|
|
if ( IsObjSelected() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 30.06.2003 #108784# - consider 'virtual' drawing objects.
|
|
|
|
|
// Thus, use corresponding method instead of checking type.
|
|
|
|
|
if ( pObj->IsGroupObject() &&
|
2005-01-05 13:29:51 +00:00
|
|
|
|
// --> FME 2004-12-08 #i38505# No ungroup allowed for 3d objects
|
|
|
|
|
!pObj->Is3DObj() &&
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
FLY_IN_CNTNT != ((SwDrawContact*)GetUserCall(pObj))->
|
2003-07-04 12:20:40 +00:00
|
|
|
|
GetFmt()->GetAnchor().GetAnchorId() )
|
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
|
return TRUE;
|
2003-07-04 12:20:40 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-04 12:20:40 +00:00
|
|
|
|
// OD 27.06.2003 #108784# - change return type.
|
|
|
|
|
// OD 27.06.2003 #108784# - adjustments for drawing objects in header/footer:
|
|
|
|
|
// allow group, only if all selected objects are in the same header/footer
|
|
|
|
|
// or not in header/footer.
|
|
|
|
|
bool SwFEShell::IsGroupAllowed() const
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2003-07-04 12:20:40 +00:00
|
|
|
|
bool bIsGroupAllowed = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( IsObjSelected() > 1 )
|
|
|
|
|
{
|
2003-07-04 12:20:40 +00:00
|
|
|
|
bIsGroupAllowed = true;
|
|
|
|
|
const SdrObject* pUpGroup = 0L;
|
|
|
|
|
const SwFrm* pHeaderFooterFrm = 0L;
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
for ( USHORT i = 0; bIsGroupAllowed && i < rMrkList.GetMarkCount(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
if ( i )
|
|
|
|
|
bIsGroupAllowed = pObj->GetUpGroup() == pUpGroup;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
|
|
|
|
pUpGroup = pObj->GetUpGroup();
|
|
|
|
|
|
2006-12-01 13:24:45 +00:00
|
|
|
|
// --> OD 2006-11-06 #130889# - make code robust
|
|
|
|
|
// if ( bIsGroupAllowed &&
|
|
|
|
|
// FLY_IN_CNTNT == ::FindFrmFmt( (SdrObject*)pObj )->GetAnchor().GetAnchorId() )
|
|
|
|
|
// {
|
|
|
|
|
// bIsGroupAllowed = false;
|
|
|
|
|
// }
|
|
|
|
|
if ( bIsGroupAllowed )
|
2003-07-04 12:20:40 +00:00
|
|
|
|
{
|
2006-12-01 13:24:45 +00:00
|
|
|
|
SwFrmFmt* pFrmFmt( ::FindFrmFmt( const_cast<SdrObject*>(pObj) ) );
|
|
|
|
|
if ( !pFrmFmt )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( false,
|
|
|
|
|
"<SwFEShell::IsGroupAllowed()> - missing frame format" );
|
|
|
|
|
bIsGroupAllowed = false;
|
|
|
|
|
}
|
|
|
|
|
else if ( FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId() )
|
|
|
|
|
{
|
|
|
|
|
bIsGroupAllowed = false;
|
|
|
|
|
}
|
2003-07-04 12:20:40 +00:00
|
|
|
|
}
|
2006-12-01 13:24:45 +00:00
|
|
|
|
// <--
|
2003-07-04 12:20:40 +00:00
|
|
|
|
|
|
|
|
|
// OD 27.06.2003 #108784# - check, if all selected objects are in the
|
|
|
|
|
// same header/footer or not in header/footer.
|
|
|
|
|
if ( bIsGroupAllowed )
|
|
|
|
|
{
|
|
|
|
|
const SwFrm* pAnchorFrm = 0L;
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if ( pObj->ISA(SwVirtFlyDrawObj) )
|
2003-07-04 12:20:40 +00:00
|
|
|
|
{
|
|
|
|
|
const SwFlyFrm* pFlyFrm =
|
|
|
|
|
static_cast<const SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
|
|
|
|
|
if ( pFlyFrm )
|
|
|
|
|
{
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pAnchorFrm = pFlyFrm->GetAnchorFrm();
|
2003-07-04 12:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-06-28 12:34:54 +00:00
|
|
|
|
SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
|
|
|
|
|
if ( pDrawContact )
|
2003-07-04 12:20:40 +00:00
|
|
|
|
{
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pAnchorFrm = pDrawContact->GetAnchorFrm( pObj );
|
2003-07-04 12:20:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( pAnchorFrm )
|
|
|
|
|
{
|
|
|
|
|
if ( i )
|
|
|
|
|
{
|
|
|
|
|
bIsGroupAllowed =
|
|
|
|
|
( pAnchorFrm->FindFooterOrHeader() == pHeaderFooterFrm );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pHeaderFooterFrm = pAnchorFrm->FindFooterOrHeader();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2003-07-04 12:20:40 +00:00
|
|
|
|
|
|
|
|
|
return bIsGroupAllowed;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::GroupSelection()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Die Gruppe bekommt den Anker und das Contactobjekt
|
|
|
|
|
|* des ersten in der Selektion
|
|
|
|
|
|* Ersterstellung MA 30. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 23. Apr. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::GroupSelection()
|
|
|
|
|
{
|
|
|
|
|
if ( IsGroupAllowed() )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
StartUndo( UNDO_START );
|
|
|
|
|
|
|
|
|
|
GetDoc()->GroupSelection( *Imp()->GetDrawView() );
|
|
|
|
|
|
|
|
|
|
EndUndo( UNDO_END );
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::UnGroupSelection()
|
|
|
|
|
|*
|
|
|
|
|
|* Beschreibung Die Einzelobjekte bekommen eine Kopie vom Anker und
|
|
|
|
|
|* Contactobjekt der Gruppe.
|
|
|
|
|
|* Ersterstellung MA 30. Jan. 95
|
|
|
|
|
|* Letzte Aenderung MA 01. Feb. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::UnGroupSelection()
|
|
|
|
|
{
|
|
|
|
|
if ( IsGroupSelected() )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
StartUndo( UNDO_START );
|
|
|
|
|
|
|
|
|
|
GetDoc()->UnGroupSelection( *Imp()->GetDrawView() );
|
|
|
|
|
|
|
|
|
|
EndUndo( UNDO_END );
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* SwFEShell::MirrorSelection()
|
|
|
|
|
|*
|
|
|
|
|
|* Ersterstellung MA 06. Aug. 95
|
|
|
|
|
|* Letzte Aenderung MA 06. Aug. 95
|
|
|
|
|
|*
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SwFEShell::MirrorSelection( BOOL bHorizontal )
|
|
|
|
|
{
|
|
|
|
|
SdrView *pView = Imp()->GetDrawView();
|
|
|
|
|
if ( IsObjSelected() && pView->IsMirrorAllowed() )
|
|
|
|
|
{
|
|
|
|
|
if ( bHorizontal )
|
|
|
|
|
pView->MirrorAllMarkedHorizontal();
|
|
|
|
|
else
|
|
|
|
|
pView->MirrorAllMarkedVertical();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// springe zum benannten Rahmen (Grafik/OLE)
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::GotoFly( const String& rName, FlyCntType eType, BOOL bSelFrm )
|
|
|
|
|
{
|
|
|
|
|
BOOL bRet = FALSE;
|
|
|
|
|
static BYTE __READONLY_DATA aChkArr[ 4 ] = {
|
|
|
|
|
/* FLYCNTTYPE_ALL */ 0,
|
|
|
|
|
/* FLYCNTTYPE_FRM */ ND_TEXTNODE,
|
|
|
|
|
/* FLYCNTTYPE_GRF */ ND_GRFNODE,
|
|
|
|
|
/* FLYCNTTYPE_OLE */ ND_OLENODE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const SwFlyFrmFmt* pFlyFmt = pDoc->FindFlyByName( rName, aChkArr[ eType]);
|
|
|
|
|
if( pFlyFmt )
|
|
|
|
|
{
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
|
|
|
|
|
SwClientIter aIter( *(SwModify*)pFlyFmt );
|
|
|
|
|
SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm ));
|
|
|
|
|
if( pFrm )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( pFrm->IsFlyFrm(), "Wrong FrmType" );
|
|
|
|
|
if( bSelFrm )
|
|
|
|
|
{
|
2002-04-09 13:21:41 +00:00
|
|
|
|
SelectObj( pFrm->Frm().Pos(), 0, ((SwFlyFrm*)pFrm)->GetVirtDrawObj() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( !ActionPend() )
|
|
|
|
|
MakeVisible( pFrm->Frm() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-08-02 13:03:20 +00:00
|
|
|
|
// --> OD 2004-06-11 #i28701# - no format here
|
|
|
|
|
// pFrm->GetAnchorFrm()->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwCntntFrm *pCFrm = pFrm->ContainsCntnt();
|
|
|
|
|
if ( pCFrm )
|
|
|
|
|
{
|
|
|
|
|
SwCntntNode *pCNode = pCFrm->GetNode();
|
|
|
|
|
ClearMark();
|
|
|
|
|
SwPaM* pCrsr = GetCrsr();
|
|
|
|
|
|
|
|
|
|
pCrsr->GetPoint()->nNode = *pCNode;
|
|
|
|
|
pCrsr->GetPoint()->nContent.Assign( pCNode, 0 );
|
|
|
|
|
|
|
|
|
|
SwRect& rChrRect = (SwRect&)GetCharRect();
|
|
|
|
|
rChrRect = pFrm->Prt();
|
|
|
|
|
rChrRect.Pos() += pFrm->Frm().Pos();
|
|
|
|
|
GetCrsrDocPos() = rChrRect.Pos();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bRet = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-27 07:51:28 +00:00
|
|
|
|
USHORT SwFEShell::GetFlyCount( FlyCntType eType ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
return GetDoc()->GetFlyCount(eType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SwFrmFmt* SwFEShell::GetFlyNum(USHORT nIdx, FlyCntType eType ) const
|
|
|
|
|
{
|
|
|
|
|
return GetDoc()->GetFlyNum(nIdx, eType );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// zeige das akt. selektierte "Object" an
|
|
|
|
|
void SwFEShell::MakeSelVisible()
|
|
|
|
|
{
|
|
|
|
|
if( Imp()->HasDrawView() &&
|
2004-07-12 14:47:48 +00:00
|
|
|
|
Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SwCrsrShell::MakeSelVisible();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Welcher Schutz ist am selektierten Objekt gesetzt?
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
int nChk = 0;
|
2007-09-27 07:51:28 +00:00
|
|
|
|
const bool bParent = (eType & FLYPROTECT_PARENT);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( Imp()->HasDrawView() )
|
|
|
|
|
{
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for( ULONG i = rMrkList.GetMarkCount(); i; )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( --i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if( !bParent )
|
|
|
|
|
{
|
|
|
|
|
nChk |= ( pObj->IsMoveProtect() ? FLYPROTECT_POS : 0 ) |
|
|
|
|
|
( pObj->IsResizeProtect()? FLYPROTECT_SIZE : 0 );
|
|
|
|
|
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if( FLYPROTECT_CONTENT & eType && pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
|
|
|
|
|
if ( pFly->GetFmt()->GetProtect().IsCntntProtected() )
|
|
|
|
|
nChk |= FLYPROTECT_CONTENT;
|
|
|
|
|
|
|
|
|
|
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
|
|
|
|
|
{
|
|
|
|
|
SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode();
|
|
|
|
|
if ( pNd )
|
|
|
|
|
{
|
2004-10-04 18:06:57 +00:00
|
|
|
|
uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
|
|
|
|
|
|
|
|
|
|
// TODO/LATER: use correct aspect
|
|
|
|
|
if ( xObj.is() &&
|
|
|
|
|
embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
nChk |= FLYPROTECT_SIZE;
|
|
|
|
|
nChk |= FLYPROTECT_FIXED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nChk &= eType;
|
|
|
|
|
if( nChk == eType )
|
2007-09-27 07:51:28 +00:00
|
|
|
|
return static_cast<BYTE>(eType);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
2004-06-28 12:34:54 +00:00
|
|
|
|
const SwFrm* pAnch;
|
2003-11-24 15:03:25 +00:00
|
|
|
|
if( pObj->ISA(SwVirtFlyDrawObj) )
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pAnch = ( (SwVirtFlyDrawObj*)pObj )->GetFlyFrm()->GetAnchorFrm();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SwDrawContact* pTmp = (SwDrawContact*)GetUserCall(pObj);
|
2004-06-28 12:34:54 +00:00
|
|
|
|
pAnch = pTmp ? pTmp->GetAnchorFrm( pObj ) : NULL;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
if( pAnch && pAnch->IsProtected() )
|
2007-09-27 07:51:28 +00:00
|
|
|
|
return static_cast<BYTE>(eType);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2007-09-27 07:51:28 +00:00
|
|
|
|
return static_cast<BYTE>(nChk);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
|
|
|
|
|
{
|
|
|
|
|
if ( !IsObjSelected() )
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
|
2007-07-31 16:41:19 +00:00
|
|
|
|
// --> OD 2007-07-24 #143008# - make code robust
|
|
|
|
|
ASSERT( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact> - please inform OD." );
|
|
|
|
|
if ( pContact )
|
|
|
|
|
{
|
|
|
|
|
if ( i )
|
|
|
|
|
rSet.MergeValues( pContact->GetFmt()->GetAttrSet() );
|
|
|
|
|
else
|
|
|
|
|
rSet.Put( pContact->GetFmt()->GetAttrSet() );
|
|
|
|
|
}
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::SetObjAttr( const SfxItemSet& rSet )
|
|
|
|
|
{
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
|
|
|
|
|
if ( !rSet.Count() )
|
|
|
|
|
{ ASSERT( !this, "SetObjAttr, empty set." );
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StartAllAction();
|
|
|
|
|
StartUndo( UNDO_INSATTR );
|
|
|
|
|
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
|
|
|
|
|
GetDoc()->SetAttr( rSet, *pContact->GetFmt() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EndUndo( UNDO_INSATTR );
|
|
|
|
|
EndAllActionAndCall();
|
|
|
|
|
GetDoc()->SetModified();
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL SwFEShell::IsAlignPossible() const
|
|
|
|
|
{
|
|
|
|
|
USHORT nCnt;
|
|
|
|
|
if ( 0 < (nCnt = IsObjSelected()) )
|
|
|
|
|
{
|
|
|
|
|
BOOL bRet = TRUE;
|
|
|
|
|
if ( nCnt == 1 )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
|
2003-03-27 14:45:43 +00:00
|
|
|
|
//only as character bound drawings can be aligned
|
|
|
|
|
bRet = pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_IN_CNTNT;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
if ( bRet )
|
|
|
|
|
return Imp()->GetDrawView()->IsAlignPossible();
|
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Temporaerer Fix bis SS von JOE da ist
|
|
|
|
|
void SwFEShell::CheckUnboundObjects()
|
|
|
|
|
{
|
|
|
|
|
SET_CURR_SHELL( this );
|
|
|
|
|
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
|
{
|
2006-07-25 11:33:25 +00:00
|
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( !GetUserCall(pObj) )
|
|
|
|
|
{
|
|
|
|
|
const Rectangle &rBound = pObj->GetSnapRect();
|
|
|
|
|
const Point aPt( rBound.TopLeft() );
|
|
|
|
|
const SwFrm *pPage = GetLayout()->Lower();
|
|
|
|
|
const SwFrm *pLast = pPage;
|
|
|
|
|
while ( pPage && !pPage->Frm().IsInside( aPt ) )
|
|
|
|
|
{
|
|
|
|
|
if ( aPt.Y() > pPage->Frm().Bottom() )
|
|
|
|
|
pLast = pPage;
|
|
|
|
|
pPage = pPage->GetNext();
|
|
|
|
|
}
|
|
|
|
|
if ( !pPage )
|
|
|
|
|
pPage = pLast;
|
|
|
|
|
ASSERT( pPage, "Page not found." );
|
|
|
|
|
|
|
|
|
|
//Fremde Identifier sollen in den Default laufen.
|
|
|
|
|
//Ueberschneidungen sind moeglich!!
|
|
|
|
|
UINT16 nIdent =
|
|
|
|
|
Imp()->GetDrawView()->GetCurrentObjInventor() == SdrInventor ?
|
|
|
|
|
Imp()->GetDrawView()->GetCurrentObjIdentifier() : 0xFFFF;
|
|
|
|
|
|
|
|
|
|
SwFmtAnchor aAnch;
|
|
|
|
|
const SwFrm *pAnch = 0;
|
|
|
|
|
{
|
|
|
|
|
pAnch = ::FindAnchor( pPage, aPt, TRUE );
|
|
|
|
|
SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
|
|
|
|
|
aAnch.SetType( FLY_AT_CNTNT );
|
|
|
|
|
aAnch.SetAnchor( &aPos );
|
|
|
|
|
((SwRect&)GetCharRect()).Pos() = aPt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Erst hier die Action, damit das GetCharRect aktuelle Werte liefert.
|
|
|
|
|
StartAllAction();
|
|
|
|
|
|
|
|
|
|
SfxItemSet aSet( GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE,
|
|
|
|
|
RES_SURROUND, RES_ANCHOR, 0 );
|
|
|
|
|
aSet.Put( aAnch );
|
|
|
|
|
|
|
|
|
|
Point aRelNullPt;
|
|
|
|
|
|
|
|
|
|
if( OBJ_CAPTION == nIdent )
|
|
|
|
|
aRelNullPt = ((SdrCaptionObj*)pObj)->GetTailPos();
|
|
|
|
|
else
|
|
|
|
|
aRelNullPt = rBound.TopLeft();
|
|
|
|
|
|
|
|
|
|
aSet.Put( aAnch );
|
|
|
|
|
aSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
|
2006-08-14 15:15:42 +00:00
|
|
|
|
SwFrmFmt* pFmt = getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
SwDrawContact *pContact = new SwDrawContact(
|
|
|
|
|
(SwDrawFrmFmt*)pFmt, pObj );
|
2002-09-16 07:47:13 +00:00
|
|
|
|
|
2004-12-23 09:05:11 +00:00
|
|
|
|
// --> OD 2004-11-22 #i35635#
|
|
|
|
|
pContact->MoveObjToVisibleLayer( pObj );
|
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pContact->ConnectToLayout();
|
|
|
|
|
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SetCalcFieldValueHdl(Outliner* pOutliner)
|
|
|
|
|
{
|
|
|
|
|
GetDoc()->SetCalcFieldValueHdl(pOutliner);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
|
|
|
|
|
const Point &rPt ) const
|
|
|
|
|
{
|
|
|
|
|
rRect.Clear();
|
|
|
|
|
|
|
|
|
|
//Die Source darf noch keinen Follow haben.
|
|
|
|
|
const SwFmtChain &rChain = rSource.GetChain();
|
|
|
|
|
if ( rChain.GetNext() )
|
|
|
|
|
return SW_CHAIN_SOURCE_CHAINED;
|
|
|
|
|
|
|
|
|
|
if( Imp()->HasDrawView() )
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj;
|
|
|
|
|
SdrPageView* pPView;
|
|
|
|
|
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
|
|
|
|
|
const USHORT nOld = pDView->GetHitTolerancePixel();
|
|
|
|
|
pDView->SetHitTolerancePixel( 0 );
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) &&
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
|
|
|
|
|
rRect = pFly->Frm();
|
|
|
|
|
|
|
|
|
|
//Ziel darf natuerlich nicht gleich Source sein und es
|
|
|
|
|
//darf keine geschlossene Kette entstehen.
|
|
|
|
|
SwFrmFmt *pFmt = pFly->GetFmt();
|
|
|
|
|
return GetDoc()->Chainable(rSource, *pFmt);
|
|
|
|
|
}
|
|
|
|
|
pDView->SetHitTolerancePixel( nOld );
|
|
|
|
|
}
|
|
|
|
|
return SW_CHAIN_NOT_FOUND;
|
|
|
|
|
}
|
2002-08-09 07:54:15 +00:00
|
|
|
|
/* -----------------------------09.08.2002 07:40------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
|
|
|
|
|
{
|
|
|
|
|
return GetDoc()->Chain(rSource, rDest);
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
int SwFEShell::Chain( SwFrmFmt &rSource, const Point &rPt )
|
|
|
|
|
{
|
|
|
|
|
SwRect aDummy;
|
|
|
|
|
int nErr = Chainable( aDummy, rSource, rPt );
|
|
|
|
|
if ( !nErr )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
SdrObject* pObj;
|
|
|
|
|
SdrPageView* pPView;
|
|
|
|
|
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView();
|
|
|
|
|
const USHORT nOld = pDView->GetHitTolerancePixel();
|
|
|
|
|
pDView->SetHitTolerancePixel( 0 );
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
pDView->SetHitTolerancePixel( nOld );
|
|
|
|
|
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
|
|
|
|
|
|
|
|
|
|
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)pFly->GetFmt();
|
|
|
|
|
GetDoc()->Chain(rSource, *pFmt);
|
|
|
|
|
EndAllAction();
|
|
|
|
|
SetChainMarker();
|
|
|
|
|
}
|
|
|
|
|
return nErr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::Unchain( SwFrmFmt &rFmt )
|
|
|
|
|
{
|
|
|
|
|
StartAllAction();
|
|
|
|
|
GetDoc()->Unchain(rFmt);
|
|
|
|
|
EndAllAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwFEShell::HideChainMarker()
|
|
|
|
|
{
|
|
|
|
|
if ( pChainFrom )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
|
|
|
|
delete pChainFrom;
|
|
|
|
|
pChainFrom = 0L;
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( pChainTo )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
|
|
|
|
delete pChainTo;
|
|
|
|
|
pChainTo = 0L;
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwFEShell::SetChainMarker()
|
|
|
|
|
{
|
2007-09-27 07:51:28 +00:00
|
|
|
|
BOOL bDelFrom = TRUE,
|
2000-09-18 23:08:29 +00:00
|
|
|
|
bDelTo = TRUE;
|
|
|
|
|
if ( IsFrmSelected() )
|
|
|
|
|
{
|
|
|
|
|
SwFlyFrm *pFly = FindFlyFrm();
|
|
|
|
|
|
|
|
|
|
if ( pFly->GetPrevLink() )
|
|
|
|
|
{
|
|
|
|
|
bDelFrom = FALSE;
|
|
|
|
|
const SwFrm *pPre = pFly->GetPrevLink();
|
2006-11-14 14:09:49 +00:00
|
|
|
|
|
|
|
|
|
Point aStart( pPre->Frm().Right(), pPre->Frm().Bottom());
|
|
|
|
|
Point aEnd(pFly->Frm().Pos());
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( !pChainFrom )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
|
|
|
|
pChainFrom = new SdrDropMarkerOverlay( *GetDrawView(), aStart, aEnd );
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
if ( pFly->GetNextLink() )
|
|
|
|
|
{
|
|
|
|
|
bDelTo = FALSE;
|
|
|
|
|
const SwFlyFrm *pNxt = pFly->GetNextLink();
|
2006-11-14 14:09:49 +00:00
|
|
|
|
|
|
|
|
|
Point aStart( pFly->Frm().Right(), pFly->Frm().Bottom());
|
|
|
|
|
Point aEnd(pNxt->Frm().Pos());
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( !pChainTo )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
|
|
|
|
pChainTo = new SdrDropMarkerOverlay( *GetDrawView(), aStart, aEnd );
|
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-11-14 14:09:49 +00:00
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( bDelFrom )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
|
delete pChainFrom, pChainFrom = 0;
|
2006-11-14 14:09:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
if ( bDelTo )
|
2006-11-14 14:09:49 +00:00
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
|
delete pChainTo, pChainTo = 0;
|
2006-11-14 14:09:49 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
|
|
|
|
|
{
|
|
|
|
|
SwFrm *pFrm = GetCurrFrm();
|
|
|
|
|
// Steht der Cursor z.Z. in einem SectionFrm?
|
|
|
|
|
if( pFrm && pFrm->IsInSct() )
|
|
|
|
|
{
|
|
|
|
|
SwSectionFrm* pSect = pFrm->FindSctFrm();
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
// Ist es der Gewuenschte?
|
|
|
|
|
if( pSect->GetRegisteredIn() == &rFmt )
|
|
|
|
|
return pSect->Frm().Width();
|
|
|
|
|
// fuer geschachtelte Bereiche
|
|
|
|
|
pSect = pSect->GetUpper()->FindSctFrm();
|
|
|
|
|
}
|
|
|
|
|
while( pSect );
|
|
|
|
|
}
|
|
|
|
|
SwClientIter aIter( rFmt );
|
|
|
|
|
SwClient *pLast = aIter.GoStart();
|
|
|
|
|
while ( pLast )
|
|
|
|
|
{
|
|
|
|
|
if ( pLast->IsA( TYPE(SwFrm) ) )
|
|
|
|
|
{
|
|
|
|
|
SwSectionFrm* pSct = (SwSectionFrm*)pLast;
|
|
|
|
|
if( !pSct->IsFollow() )
|
|
|
|
|
return pSct->Frm().Width();
|
|
|
|
|
}
|
|
|
|
|
pLast = aIter++;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-06-24 13:53:54 +00:00
|
|
|
|
/* -----------------------------2002/06/24 15:07------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2007-09-27 07:51:28 +00:00
|
|
|
|
void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
|
2002-06-24 13:53:54 +00:00
|
|
|
|
USHORT nSlotId)
|
|
|
|
|
{
|
|
|
|
|
SdrView* pDrawView = GetDrawView();
|
|
|
|
|
SdrModel* pDrawModel = pDrawView->GetModel();
|
|
|
|
|
SdrObject* pObj = SdrObjFactory::MakeNewObject(
|
|
|
|
|
SdrInventor, eSdrObjectKind,
|
|
|
|
|
0L, pDrawModel);
|
|
|
|
|
|
|
|
|
|
if(pObj)
|
|
|
|
|
{
|
|
|
|
|
Rectangle aRect(rRect);
|
|
|
|
|
if(OBJ_CARC == eSdrObjectKind || OBJ_CCUT == eSdrObjectKind)
|
|
|
|
|
{
|
|
|
|
|
// force quadratic
|
|
|
|
|
if(aRect.GetWidth() > aRect.GetHeight())
|
|
|
|
|
{
|
|
|
|
|
aRect = Rectangle(
|
|
|
|
|
Point(aRect.Left() + ((aRect.GetWidth() - aRect.GetHeight()) / 2), aRect.Top()),
|
|
|
|
|
Size(aRect.GetHeight(), aRect.GetHeight()));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aRect = Rectangle(
|
|
|
|
|
Point(aRect.Left(), aRect.Top() + ((aRect.GetHeight() - aRect.GetWidth()) / 2)),
|
|
|
|
|
Size(aRect.GetWidth(), aRect.GetWidth()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pObj->SetLogicRect(aRect);
|
|
|
|
|
|
|
|
|
|
if(pObj->ISA(SdrCircObj))
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aAttr(pDrawModel->GetItemPool());
|
|
|
|
|
aAttr.Put(SdrCircStartAngleItem(9000));
|
|
|
|
|
aAttr.Put(SdrCircEndAngleItem(0));
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pObj->SetMergedItemSet(aAttr);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
else if(pObj->ISA(SdrPathObj))
|
|
|
|
|
{
|
2007-07-18 09:48:48 +00:00
|
|
|
|
basegfx::B2DPolyPolygon aPoly;
|
2002-06-24 13:53:54 +00:00
|
|
|
|
|
|
|
|
|
switch(eSdrObjectKind)
|
|
|
|
|
{
|
|
|
|
|
case OBJ_PATHLINE:
|
|
|
|
|
{
|
2007-07-18 09:48:48 +00:00
|
|
|
|
basegfx::B2DPolygon aInnerPoly;
|
|
|
|
|
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
|
|
|
|
|
|
|
|
|
|
const basegfx::B2DPoint aCenterBottom(aRect.Center().X(), aRect.Bottom());
|
|
|
|
|
aInnerPoly.appendBezierSegment(
|
|
|
|
|
aCenterBottom,
|
|
|
|
|
aCenterBottom,
|
|
|
|
|
basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
|
|
|
|
|
|
|
|
|
|
const basegfx::B2DPoint aCenterTop(aRect.Center().X(), aRect.Top());
|
|
|
|
|
aInnerPoly.appendBezierSegment(
|
|
|
|
|
aCenterTop,
|
|
|
|
|
aCenterTop,
|
|
|
|
|
basegfx::B2DPoint(aRect.Right(), aRect.Top()));
|
|
|
|
|
|
2006-11-14 14:09:49 +00:00
|
|
|
|
aInnerPoly.setClosed(true);
|
|
|
|
|
aPoly.append(aInnerPoly);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case OBJ_FREELINE:
|
|
|
|
|
{
|
2007-07-18 09:48:48 +00:00
|
|
|
|
basegfx::B2DPolygon aInnerPoly;
|
|
|
|
|
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
|
|
|
|
|
|
|
|
|
|
aInnerPoly.appendBezierSegment(
|
|
|
|
|
basegfx::B2DPoint(aRect.Left(), aRect.Top()),
|
|
|
|
|
basegfx::B2DPoint(aRect.Center().X(), aRect.Top()),
|
|
|
|
|
basegfx::B2DPoint(aRect.Center().X(), aRect.Center().Y()));
|
|
|
|
|
|
|
|
|
|
aInnerPoly.appendBezierSegment(
|
|
|
|
|
basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()),
|
|
|
|
|
basegfx::B2DPoint(aRect.Right(), aRect.Bottom()),
|
|
|
|
|
basegfx::B2DPoint(aRect.Right(), aRect.Top()));
|
|
|
|
|
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom()));
|
2006-11-14 14:09:49 +00:00
|
|
|
|
aInnerPoly.setClosed(true);
|
|
|
|
|
aPoly.append(aInnerPoly);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case OBJ_POLY:
|
|
|
|
|
case OBJ_PLIN:
|
|
|
|
|
{
|
2007-07-18 09:48:48 +00:00
|
|
|
|
basegfx::B2DPolygon aInnerPoly;
|
2002-06-24 13:53:54 +00:00
|
|
|
|
sal_Int32 nWdt(aRect.GetWidth());
|
|
|
|
|
sal_Int32 nHgt(aRect.GetHeight());
|
|
|
|
|
|
2007-07-18 09:48:48 +00:00
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Bottom()));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 30) / 100, aRect.Top() + (nHgt * 70) / 100));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Top() + (nHgt * 15) / 100));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 65) / 100, aRect.Top()));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + nWdt, aRect.Top() + (nHgt * 30) / 100));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 50) / 100));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 75) / 100));
|
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Bottom(), aRect.Right()));
|
2002-06-24 13:53:54 +00:00
|
|
|
|
|
|
|
|
|
if(OBJ_PLIN == eSdrObjectKind)
|
|
|
|
|
{
|
2007-07-18 09:48:48 +00:00
|
|
|
|
aInnerPoly.append(basegfx::B2DPoint(aRect.Center().X(), aRect.Bottom()));
|
2006-11-14 14:09:49 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aInnerPoly.setClosed(true);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2006-11-14 14:09:49 +00:00
|
|
|
|
aPoly.append(aInnerPoly);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case OBJ_LINE :
|
|
|
|
|
{
|
|
|
|
|
sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
|
2007-07-18 09:48:48 +00:00
|
|
|
|
basegfx::B2DPolygon aTempPoly;
|
|
|
|
|
aTempPoly.append(basegfx::B2DPoint(aRect.TopLeft().X(), nYMiddle));
|
|
|
|
|
aTempPoly.append(basegfx::B2DPoint(aRect.BottomRight().X(), nYMiddle));
|
2006-11-14 14:09:49 +00:00
|
|
|
|
aPoly.append(aTempPoly);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
((SdrPathObj*)pObj)->SetPathPoly(aPoly);
|
|
|
|
|
}
|
|
|
|
|
else if(pObj->ISA(SdrCaptionObj))
|
|
|
|
|
{
|
|
|
|
|
BOOL bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
|
|
|
|
|
SID_DRAW_CAPTION_VERTICAL == nSlotId );
|
|
|
|
|
((SdrTextObj*)pObj)->SetVerticalWriting(bVerticalText);
|
|
|
|
|
if(bVerticalText)
|
|
|
|
|
{
|
2003-11-24 15:03:25 +00:00
|
|
|
|
SfxItemSet aSet(pObj->GetMergedItemSet());
|
2002-06-24 13:53:54 +00:00
|
|
|
|
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
|
|
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pObj->SetMergedItemSet(aSet);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
2002-06-24 13:53:54 +00:00
|
|
|
|
((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
|
|
|
|
|
((SdrCaptionObj*)pObj)->SetTailPos(
|
|
|
|
|
aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
|
|
|
|
|
}
|
|
|
|
|
else if(pObj->ISA(SdrTextObj))
|
|
|
|
|
{
|
|
|
|
|
SdrTextObj* pText = (SdrTextObj*)pObj;
|
|
|
|
|
pText->SetLogicRect(aRect);
|
|
|
|
|
|
|
|
|
|
sal_Bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
|
|
|
|
|
sal_Bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nSlotId);
|
|
|
|
|
|
|
|
|
|
pText->SetVerticalWriting(bVertical);
|
|
|
|
|
|
|
|
|
|
if(bVertical)
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aSet(pDrawModel->GetItemPool());
|
|
|
|
|
aSet.Put(SdrTextAutoGrowWidthItem(TRUE));
|
|
|
|
|
aSet.Put(SdrTextAutoGrowHeightItem(FALSE));
|
|
|
|
|
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
|
|
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pText->SetMergedItemSet(aSet);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(bMarquee)
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aSet(pDrawModel->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
|
|
|
|
|
aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
|
|
|
|
|
aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
|
|
|
|
|
aSet.Put( SdrTextAniKindItem( SDRTEXTANI_SLIDE ) );
|
|
|
|
|
aSet.Put( SdrTextAniDirectionItem( SDRTEXTANI_LEFT ) );
|
|
|
|
|
aSet.Put( SdrTextAniCountItem( 1 ) );
|
|
|
|
|
aSet.Put( SdrTextAniAmountItem( (INT16)GetWin()->PixelToLogic(Size(2,1)).Width()) );
|
2003-11-24 15:03:25 +00:00
|
|
|
|
pObj->SetMergedItemSetAndBroadcast(aSet);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-11-14 14:09:49 +00:00
|
|
|
|
SdrPageView* pPageView = pDrawView->GetSdrPageView();
|
|
|
|
|
pDrawView->InsertObjectAtView(pObj, *pPageView);
|
2002-06-24 13:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
ImpEndCreate();
|
|
|
|
|
}
|
2002-09-03 07:15:48 +00:00
|
|
|
|
|
|
|
|
|
/** SwFEShell::GetShapeBackgrd
|
|
|
|
|
|
|
|
|
|
OD 02.09.2002 for #102450#:
|
|
|
|
|
method determines background color of the page the selected drawing
|
|
|
|
|
object is on and returns this color.
|
|
|
|
|
If no color is found, because no drawing object is selected or ...,
|
|
|
|
|
color COL_BLACK (default color on constructing object of class Color)
|
|
|
|
|
is returned.
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
|
|
|
|
|
@returns an object of class Color
|
|
|
|
|
*/
|
|
|
|
|
const Color SwFEShell::GetShapeBackgrd() const
|
|
|
|
|
{
|
|
|
|
|
Color aRetColor;
|
|
|
|
|
|
|
|
|
|
// check, if a draw view exists
|
|
|
|
|
ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
|
|
|
|
|
if( Imp()->GetDrawView() )
|
|
|
|
|
{
|
|
|
|
|
// determine list of selected objects
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
|
2002-09-03 07:15:48 +00:00
|
|
|
|
// check, if exactly one object is selected.
|
|
|
|
|
ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
|
|
|
|
|
if ( pMrkList->GetMarkCount() == 1)
|
|
|
|
|
{
|
|
|
|
|
// get selected object
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
|
2002-09-03 07:15:48 +00:00
|
|
|
|
// check, if selected object is a shape (drawing object)
|
2003-11-24 15:03:25 +00:00
|
|
|
|
ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
|
|
|
|
|
if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
|
2002-09-03 07:15:48 +00:00
|
|
|
|
{
|
|
|
|
|
// determine page frame of the frame the shape is anchored.
|
|
|
|
|
const SwFrm* pAnchorFrm =
|
2004-06-28 12:34:54 +00:00
|
|
|
|
static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
|
2002-09-03 07:15:48 +00:00
|
|
|
|
ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
|
|
|
|
|
if ( pAnchorFrm )
|
|
|
|
|
{
|
|
|
|
|
const SwPageFrm* pPageFrm = pAnchorFrm->FindPageFrm();
|
|
|
|
|
ASSERT( pPageFrm, "inconsistent modell - no page!");
|
|
|
|
|
if ( pPageFrm )
|
|
|
|
|
{
|
|
|
|
|
aRetColor = pPageFrm->GetDrawBackgrdColor();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return aRetColor;
|
|
|
|
|
}
|
2002-12-10 13:12:18 +00:00
|
|
|
|
|
|
|
|
|
/** Is default horizontal text direction for selected drawing object right-to-left
|
|
|
|
|
|
|
|
|
|
OD 09.12.2002 #103045#
|
|
|
|
|
Because drawing objects only painted for each page only, the default
|
|
|
|
|
horizontal text direction of a drawing object is given by the corresponding
|
|
|
|
|
page property.
|
|
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
|
|
|
|
|
|
@returns boolean, indicating, if the horizontal text direction of the
|
|
|
|
|
page, the selected drawing object is on, is right-to-left.
|
|
|
|
|
*/
|
2008-10-10 13:02:43 +00:00
|
|
|
|
bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
|
2002-12-10 13:12:18 +00:00
|
|
|
|
{
|
|
|
|
|
bool bRet = false;
|
|
|
|
|
|
|
|
|
|
// check, if a draw view exists
|
|
|
|
|
ASSERT( Imp()->GetDrawView(), "wrong usage of SwFEShell::GetShapeBackgrd - no draw view!");
|
|
|
|
|
if( Imp()->GetDrawView() )
|
|
|
|
|
{
|
|
|
|
|
// determine list of selected objects
|
2004-07-12 14:47:48 +00:00
|
|
|
|
const SdrMarkList* pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
|
2002-12-10 13:12:18 +00:00
|
|
|
|
// check, if exactly one object is selected.
|
|
|
|
|
ASSERT( pMrkList->GetMarkCount() == 1, "wrong usage of SwFEShell::GetShapeBackgrd - no selected object!");
|
|
|
|
|
if ( pMrkList->GetMarkCount() == 1)
|
|
|
|
|
{
|
|
|
|
|
// get selected object
|
2006-07-25 11:33:25 +00:00
|
|
|
|
const SdrObject *pSdrObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
|
2002-12-10 13:12:18 +00:00
|
|
|
|
// check, if selected object is a shape (drawing object)
|
2003-11-24 15:03:25 +00:00
|
|
|
|
ASSERT( !pSdrObj->ISA(SwVirtFlyDrawObj), "wrong usage of SwFEShell::GetShapeBackgrd - selected object is not a drawing object!");
|
|
|
|
|
if ( !pSdrObj->ISA(SwVirtFlyDrawObj) )
|
2002-12-10 13:12:18 +00:00
|
|
|
|
{
|
|
|
|
|
// determine page frame of the frame the shape is anchored.
|
|
|
|
|
const SwFrm* pAnchorFrm =
|
2004-06-28 12:34:54 +00:00
|
|
|
|
static_cast<SwDrawContact*>(GetUserCall(pSdrObj))->GetAnchorFrm( pSdrObj );
|
2002-12-10 13:12:18 +00:00
|
|
|
|
ASSERT( pAnchorFrm, "inconsistent modell - no anchor at shape!");
|
|
|
|
|
if ( pAnchorFrm )
|
|
|
|
|
{
|
|
|
|
|
const SwPageFrm* pPageFrm = pAnchorFrm->FindPageFrm();
|
|
|
|
|
ASSERT( pPageFrm, "inconsistent modell - no page!");
|
|
|
|
|
if ( pPageFrm )
|
|
|
|
|
{
|
|
|
|
|
bRet = pPageFrm->IsRightToLeft() ? true : false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
|
}
|
2003-04-04 17:11:30 +00:00
|
|
|
|
/* -----------------20.03.2003 14:35-----------------
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
|
|
|
|
|
{
|
|
|
|
|
Point aRet(-1, -1);
|
|
|
|
|
const SwFrm *pPage = GetLayout()->Lower();
|
|
|
|
|
while ( pPage && !pPage->Frm().IsInside( rDocPos ) )
|
|
|
|
|
{
|
|
|
|
|
pPage = pPage->GetNext();
|
|
|
|
|
}
|
|
|
|
|
if(pPage)
|
|
|
|
|
{
|
|
|
|
|
aRet = rDocPos - pPage->Frm().TopLeft();
|
|
|
|
|
}
|
|
|
|
|
return aRet;
|
|
|
|
|
}
|
|
|
|
|
|