2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 12:10:20 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:10:20 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:10:20 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:10:20 +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 12:10:20 +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 12:10:20 +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 19:51:40 +00:00
|
|
|
|
2010-11-25 14:31:08 +01:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <hintids.hxx>
|
2001-07-23 16:20:51 +00:00
|
|
|
#include <rtl/logfile.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <vcl/outdev.hxx>
|
|
|
|
#include <sfx2/printer.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/eeitem.hxx>
|
|
|
|
#include <editeng/flditem.hxx>
|
|
|
|
#include <editeng/editeng.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <svx/svdoutl.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/colritem.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <svx/svdpage.hxx>
|
|
|
|
#include <svx/svdogrp.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/langitem.hxx>
|
|
|
|
#include <editeng/unolingu.hxx>
|
|
|
|
#include <editeng/measfld.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <svx/svdpool.hxx>
|
|
|
|
#include <fmtanchr.hxx>
|
|
|
|
#include <charatr.hxx>
|
|
|
|
#include <frmfmt.hxx>
|
|
|
|
#include <charfmt.hxx>
|
|
|
|
#include <viewimp.hxx>
|
|
|
|
#include <swhints.hxx>
|
|
|
|
#include <doc.hxx>
|
2010-11-25 14:31:08 +01:00
|
|
|
#include <IDocumentUndoRedo.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <docsh.hxx>
|
2011-11-25 00:45:15 +01:00
|
|
|
#include <rootfrm.hxx> // So that the RootDtor is called.
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <poolfmt.hxx>
|
2011-11-25 00:45:15 +01:00
|
|
|
#include <viewsh.hxx> // for MakeDrawView
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <drawdoc.hxx>
|
2010-12-15 09:14:15 +01:00
|
|
|
#include <UndoDraw.hxx>
|
2011-11-25 00:45:15 +01:00
|
|
|
#include <swundo.hxx> // for the UndoIds
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <dcontact.hxx>
|
|
|
|
#include <dview.hxx>
|
|
|
|
#include <mvsave.hxx>
|
|
|
|
#include <flyfrm.hxx>
|
|
|
|
#include <dflyobj.hxx>
|
2001-02-09 13:58:22 +00:00
|
|
|
#include <svx/svdetc.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/fhgtitem.hxx>
|
2003-07-04 12:19:16 +00:00
|
|
|
#include <svx/svdpagv.hxx>
|
2004-06-28 12:32:00 +00:00
|
|
|
#include <txtfrm.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/frmdiritem.hxx>
|
2004-06-28 12:32:00 +00:00
|
|
|
#include <fmtornt.hxx>
|
2006-03-22 11:22:53 +00:00
|
|
|
#include <svx/svditer.hxx>
|
2010-10-18 12:55:43 +01:00
|
|
|
|
2006-12-01 13:23:59 +00:00
|
|
|
#include <vector>
|
2010-12-17 09:02:23 +01:00
|
|
|
#include <switerator.hxx>
|
2003-07-04 12:19:16 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
using namespace ::com::sun::star;
|
2000-10-27 10:55:57 +00:00
|
|
|
using namespace ::com::sun::star::linguistic2;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwDoc::GroupSelection / SwDoc::UnGroupSelection
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
2010-10-18 12:55:43 +01:00
|
|
|
// local method to determine positioning and
|
2004-06-28 12:32:00 +00:00
|
|
|
// alignment attributes for a drawing object, which is newly connected to
|
|
|
|
// the layout. Used for a newly formed group object <SwDoc::GroupSelection(..)>
|
|
|
|
// and the members of a destroyed group <SwDoc::UnGroupSelection(..)>
|
2005-03-23 11:56:38 +00:00
|
|
|
void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt,
|
2004-06-28 12:32:00 +00:00
|
|
|
const SdrObject& _rSdrObj )
|
|
|
|
{
|
|
|
|
const SwContact* pContact = GetUserCall( &_rSdrObj );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pContact, "<lcl_AdjustPositioningAttr(..)> - missing contact object." );
|
2004-06-28 12:32:00 +00:00
|
|
|
|
|
|
|
// determine position of new group object relative to its anchor frame position
|
|
|
|
SwTwips nHoriRelPos = 0;
|
|
|
|
SwTwips nVertRelPos = 0;
|
|
|
|
{
|
|
|
|
const SwFrm* pAnchorFrm = pContact->GetAnchoredObj( &_rSdrObj )->GetAnchorFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pAnchorFrm ||
|
2004-06-28 12:32:00 +00:00
|
|
|
!pAnchorFrm->IsTxtFrm() ||
|
|
|
|
!static_cast<const SwTxtFrm*>(pAnchorFrm)->IsFollow(),
|
|
|
|
"<lcl_AdjustPositioningAttr(..)> - anchor frame is a follow. Please inform OD." );
|
2007-09-27 07:34:21 +00:00
|
|
|
bool bVert = false;
|
|
|
|
bool bR2L = false;
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i45952# - use anchor position of anchor frame, if it exist.
|
2005-07-08 10:01:22 +00:00
|
|
|
Point aAnchorPos;
|
2004-06-28 12:32:00 +00:00
|
|
|
if ( pAnchorFrm )
|
|
|
|
{
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i45952#
|
2005-07-08 10:01:22 +00:00
|
|
|
aAnchorPos = pAnchorFrm->GetFrmAnchorPos( ::HasWrap( &_rSdrObj ) );
|
2004-06-28 12:32:00 +00:00
|
|
|
bVert = pAnchorFrm->IsVertical();
|
|
|
|
bR2L = pAnchorFrm->IsRightToLeft();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i45952#
|
2005-07-08 10:01:22 +00:00
|
|
|
aAnchorPos = _rSdrObj.GetAnchorPos();
|
2004-06-28 12:32:00 +00:00
|
|
|
// If no anchor frame exist - e.g. because no layout exists - the
|
|
|
|
// default layout direction is taken.
|
|
|
|
const SvxFrameDirectionItem* pDirItem =
|
|
|
|
static_cast<const SvxFrameDirectionItem*>(&(_pFrmFmt->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR )));
|
|
|
|
switch ( pDirItem->GetValue() )
|
|
|
|
{
|
|
|
|
case FRMDIR_VERT_TOP_LEFT:
|
|
|
|
{
|
2009-03-04 16:19:59 +00:00
|
|
|
// vertical from left-to-right - Badaa: supported now!
|
2004-06-28 12:32:00 +00:00
|
|
|
bVert = true;
|
|
|
|
bR2L = true;
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
|
2004-06-28 12:32:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FRMDIR_VERT_TOP_RIGHT:
|
|
|
|
{
|
|
|
|
// vertical from right-to-left
|
|
|
|
bVert = true;
|
|
|
|
bR2L = false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FRMDIR_HORI_RIGHT_TOP:
|
|
|
|
{
|
|
|
|
// horizontal from right-to-left
|
|
|
|
bVert = false;
|
|
|
|
bR2L = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FRMDIR_HORI_LEFT_TOP:
|
|
|
|
{
|
|
|
|
// horizontal from left-to-right
|
|
|
|
bVert = false;
|
|
|
|
bR2L = false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// use geometry of drawing object
|
2004-10-27 11:30:23 +00:00
|
|
|
const SwRect aObjRect = _rSdrObj.GetSnapRect();
|
2009-03-04 16:19:59 +00:00
|
|
|
|
2004-06-28 12:32:00 +00:00
|
|
|
if ( bVert )
|
|
|
|
{
|
2009-03-04 16:19:59 +00:00
|
|
|
if ( bR2L ) {
|
|
|
|
//FRMDIR_VERT_TOP_LEFT
|
|
|
|
nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
|
|
|
|
nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
|
|
|
|
} else {
|
|
|
|
//FRMDIR_VERT_TOP_RIGHT
|
|
|
|
nHoriRelPos = aObjRect.Top() - aAnchorPos.Y();
|
|
|
|
nVertRelPos = aAnchorPos.X() - aObjRect.Right();
|
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
}
|
|
|
|
else if ( bR2L )
|
|
|
|
{
|
|
|
|
nHoriRelPos = aAnchorPos.X() - aObjRect.Right();
|
|
|
|
nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nHoriRelPos = aObjRect.Left() - aAnchorPos.X();
|
|
|
|
nVertRelPos = aObjRect.Top() - aAnchorPos.Y();
|
|
|
|
}
|
2009-03-04 16:19:59 +00:00
|
|
|
//End of SCMS
|
2004-06-28 12:32:00 +00:00
|
|
|
}
|
|
|
|
|
2008-06-13 08:33:03 +00:00
|
|
|
_pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
|
|
|
|
_pFrmFmt->SetFmtAttr( SwFmtVertOrient( nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i44334#, #i44681# - positioning attributes already set
|
2005-03-23 11:56:38 +00:00
|
|
|
_pFrmFmt->PosAttrSet();
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i34750# - keep current object rectangle for drawing
|
2004-10-27 11:30:23 +00:00
|
|
|
// objects. The object rectangle is used on events from the drawing layer
|
|
|
|
// to adjust the positioning attributes - see <SwDrawContact::_Changed(..)>.
|
|
|
|
{
|
|
|
|
const SwAnchoredObject* pAnchoredObj = pContact->GetAnchoredObj( &_rSdrObj );
|
|
|
|
if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
|
|
|
|
{
|
|
|
|
const SwAnchoredDrawObject* pAnchoredDrawObj =
|
|
|
|
static_cast<const SwAnchoredDrawObject*>(pAnchoredObj);
|
|
|
|
const SwRect aObjRect = _rSdrObj.GetSnapRect();
|
|
|
|
const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
|
|
|
|
->SetLastObjRect( aObjRect.SVRect() );
|
|
|
|
}
|
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
|
|
|
|
{
|
2011-01-28 11:31:24 +00:00
|
|
|
// replace marked 'virtual' drawing objects by the corresponding 'master'
|
|
|
|
// drawing objects.
|
2003-07-04 12:19:16 +00:00
|
|
|
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
|
|
|
|
|
2004-07-12 14:46:37 +00:00
|
|
|
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
|
|
|
|
SwDrawFrmFmt *pFmt = 0L;
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bNoGroup = ( 0 == pObj->GetUpGroup() );
|
2004-06-28 12:32:00 +00:00
|
|
|
SwDrawContact* pNewContact = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bNoGroup )
|
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
// Revoke anchor attribute.
|
2007-09-27 07:34:21 +00:00
|
|
|
SwDrawContact *pMyContact = (SwDrawContact*)GetUserCall(pObj);
|
|
|
|
const SwFmtAnchor aAnch( pMyContact->GetFmt()->GetAnchor() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-11-25 14:31:08 +01:00
|
|
|
SwUndoDrawGroup *const pUndo = (!GetIDocumentUndoRedo().DoesUndo())
|
2005-12-28 16:11:55 +00:00
|
|
|
? 0
|
2011-01-17 15:06:54 +01:00
|
|
|
: new SwUndoDrawGroup( (sal_uInt16)rMrkList.GetMarkCount() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i53320#
|
2005-12-28 16:11:55 +00:00
|
|
|
bool bGroupMembersNotPositioned( false );
|
|
|
|
{
|
|
|
|
SwAnchoredDrawObject* pAnchoredDrawObj =
|
2007-09-27 07:34:21 +00:00
|
|
|
static_cast<SwAnchoredDrawObject*>(pMyContact->GetAnchoredObj( pObj ));
|
2005-12-28 16:11:55 +00:00
|
|
|
bGroupMembersNotPositioned = pAnchoredDrawObj->NotYetPositioned();
|
|
|
|
}
|
2011-11-25 00:45:15 +01:00
|
|
|
// Destroy ContactObjects and formats.
|
2011-01-17 15:06:54 +01:00
|
|
|
for( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2006-07-25 11:29:31 +00:00
|
|
|
pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
|
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i53320#
|
2011-11-24 00:52:07 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 0
|
2005-12-28 16:11:55 +00:00
|
|
|
SwAnchoredDrawObject* pAnchoredDrawObj =
|
|
|
|
static_cast<SwAnchoredDrawObject*>(pContact->GetAnchoredObj( pObj ));
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( bGroupMembersNotPositioned == pAnchoredDrawObj->NotYetPositioned(),
|
2005-12-28 16:11:55 +00:00
|
|
|
"<SwDoc::GroupSelection(..)> - group members have different positioning status!" );
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
|
2011-11-25 00:45:15 +01:00
|
|
|
// Deletes itself!
|
2003-11-24 15:01:11 +00:00
|
|
|
pContact->Changed(*pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
pObj->SetUserCall( 0 );
|
|
|
|
|
|
|
|
if( pUndo )
|
|
|
|
pUndo->AddObj( i, pFmt, pObj );
|
|
|
|
else
|
|
|
|
DelFrmFmt( pFmt );
|
2005-07-08 10:01:22 +00:00
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i45952# - re-introduce position normalization of group member
|
|
|
|
// objects, because its anchor position is cleared, when they are
|
|
|
|
// grouped.
|
2005-07-08 10:01:22 +00:00
|
|
|
Point aAnchorPos( pObj->GetAnchorPos() );
|
|
|
|
pObj->NbcSetAnchorPos( Point( 0, 0 ) );
|
|
|
|
pObj->NbcMove( Size( aAnchorPos.X(), aAnchorPos.Y() ) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2012-06-20 23:57:47 +01:00
|
|
|
pFmt = MakeDrawFrmFmt( rtl::OUString("DrawObject"),
|
2000-09-18 23:08:29 +00:00
|
|
|
GetDfltFrmFmt() );
|
2008-06-13 08:33:03 +00:00
|
|
|
pFmt->SetFmtAttr( aAnch );
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i36010# - set layout direction of the position
|
2004-10-27 11:30:23 +00:00
|
|
|
pFmt->SetPositionLayoutDir(
|
2007-09-27 07:34:21 +00:00
|
|
|
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:32:00 +00:00
|
|
|
rDrawView.GroupMarked();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
|
2004-06-28 12:32:00 +00:00
|
|
|
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject* pNewGroupObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
|
2004-06-28 12:32:00 +00:00
|
|
|
pNewContact = new SwDrawContact( pFmt, pNewGroupObj );
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i35635#
|
2004-12-23 09:03:59 +00:00
|
|
|
pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
|
2004-06-28 12:32:00 +00:00
|
|
|
pNewContact->ConnectToLayout();
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i53320# - No adjustment of the positioning and alignment
|
|
|
|
// attributes, if group members aren't positioned yet.
|
2005-12-28 16:11:55 +00:00
|
|
|
if ( !bGroupMembersNotPositioned )
|
|
|
|
{
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i26791# - Adjust positioning and alignment attributes.
|
2005-12-28 16:11:55 +00:00
|
|
|
lcl_AdjustPositioningAttr( pFmt, *pNewGroupObj );
|
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pUndo )
|
|
|
|
{
|
|
|
|
pUndo->SetGroupFmt( pFmt );
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo( pUndo );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
|
|
|
{
|
|
|
|
GetIDocumentUndoRedo().ClearRedo();
|
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
|
|
|
|
rDrawView.GroupMarked();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-06-28 12:32:00 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
return pNewContact;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SwDoc::UnGroupSelection( SdrView& rDrawView )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bUndo )
|
2010-11-25 14:31:08 +01:00
|
|
|
{
|
|
|
|
GetIDocumentUndoRedo().ClearRedo();
|
|
|
|
}
|
2003-07-04 12:19:16 +00:00
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// replace marked 'virtual' drawing objects by the corresponding 'master'
|
|
|
|
// drawing objects.
|
2003-07-04 12:19:16 +00:00
|
|
|
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
|
|
|
|
|
2004-07-12 14:46:37 +00:00
|
|
|
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
|
2006-12-01 13:23:59 +00:00
|
|
|
std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >* pFmtsAndObjs( 0L );
|
|
|
|
const sal_uInt32 nMarkCount( rMrkList.GetMarkCount() );
|
|
|
|
if ( nMarkCount )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2006-12-01 13:23:59 +00:00
|
|
|
pFmtsAndObjs = new std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >[nMarkCount];
|
2007-09-27 07:34:21 +00:00
|
|
|
SdrObject *pMyObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
|
|
|
|
if( !pMyObj->GetUpGroup() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-06-20 23:57:47 +01:00
|
|
|
rtl::OUString sDrwFmtNm("DrawObject");
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < nMarkCount; ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pObj->IsA( TYPE(SdrObjGroup) ) )
|
|
|
|
{
|
|
|
|
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
|
|
|
|
SwFmtAnchor aAnch( pContact->GetFmt()->GetAnchor() );
|
|
|
|
SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
|
|
|
|
|
|
|
|
SwUndoDrawUnGroup* pUndo = 0;
|
|
|
|
if( bUndo )
|
|
|
|
{
|
|
|
|
pUndo = new SwUndoDrawUnGroup( (SdrObjGroup*)pObj );
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(pUndo);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-06-28 12:32:00 +00:00
|
|
|
SdrObject* pSubObj = pLst->GetObj( i2 );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwDrawFrmFmt *pFmt = MakeDrawFrmFmt( sDrwFmtNm,
|
|
|
|
GetDfltFrmFmt() );
|
2008-06-13 08:33:03 +00:00
|
|
|
pFmt->SetFmtAttr( aAnch );
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i36010# - set layout direction of the position
|
2004-10-27 11:30:23 +00:00
|
|
|
pFmt->SetPositionLayoutDir(
|
2007-09-27 07:34:21 +00:00
|
|
|
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
|
2006-12-01 13:23:59 +00:00
|
|
|
pFmtsAndObjs[i].push_back( std::pair< SwDrawFrmFmt*, SdrObject* >( pFmt, pSubObj ) );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( bUndo )
|
|
|
|
pUndo->AddObj( i2, pFmt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rDrawView.UnGroupMarked();
|
2006-12-01 13:23:59 +00:00
|
|
|
// creation of <SwDrawContact> instances for the former group members and
|
|
|
|
// its connection to the Writer layout.
|
|
|
|
for ( sal_uInt32 i = 0; i < nMarkCount; ++i )
|
|
|
|
{
|
|
|
|
SwUndoDrawUnGroupConnectToLayout* pUndo = 0;
|
|
|
|
if( bUndo )
|
|
|
|
{
|
|
|
|
pUndo = new SwUndoDrawUnGroupConnectToLayout();
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(pUndo);
|
2006-12-01 13:23:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
while ( pFmtsAndObjs[i].size() > 0 )
|
|
|
|
{
|
|
|
|
SwDrawFrmFmt* pFmt( pFmtsAndObjs[i].back().first );
|
|
|
|
SdrObject* pObj( pFmtsAndObjs[i].back().second );
|
|
|
|
pFmtsAndObjs[i].pop_back();
|
|
|
|
|
|
|
|
SwDrawContact* pContact = new SwDrawContact( pFmt, pObj );
|
|
|
|
pContact->MoveObjToVisibleLayer( pObj );
|
|
|
|
pContact->ConnectToLayout();
|
|
|
|
lcl_AdjustPositioningAttr( pFmt, *pObj );
|
|
|
|
|
|
|
|
if ( bUndo )
|
|
|
|
{
|
|
|
|
pUndo->AddFmtAndObj( pFmt, pObj );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete [] pFmtsAndObjs;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwDoc::DeleteSelection()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bCallBase = sal_False;
|
2004-07-12 14:46:37 +00:00
|
|
|
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( rMrkList.GetMarkCount() )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 i;
|
|
|
|
sal_Bool bDelMarked = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( 1 == rMrkList.GetMarkCount() )
|
|
|
|
{
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
|
2003-11-24 15:01:11 +00:00
|
|
|
if( pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwFlyFrmFmt* pFrmFmt = (SwFlyFrmFmt*)
|
|
|
|
((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetFmt();
|
|
|
|
if( pFrmFmt )
|
|
|
|
{
|
|
|
|
DelLayoutFmt( pFrmFmt );
|
2011-01-17 15:06:54 +01:00
|
|
|
bDelMarked = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for( i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
{
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
|
2003-11-24 15:01:11 +00:00
|
|
|
if( !pObj->ISA(SwVirtFlyDrawObj) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj);
|
|
|
|
SwDrawFrmFmt *pFrmFmt = (SwDrawFrmFmt*)pC->GetFmt();
|
|
|
|
if( pFrmFmt &&
|
2010-01-05 16:37:41 +01:00
|
|
|
FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
--i;
|
|
|
|
DelLayoutFmt( pFrmFmt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( rMrkList.GetMarkCount() && bDelMarked )
|
|
|
|
{
|
2006-07-25 11:29:31 +00:00
|
|
|
SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pObj->GetUpGroup() )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
SwUndoDrawDelete *const pUndo =
|
|
|
|
(!GetIDocumentUndoRedo().DoesUndo())
|
|
|
|
? 0
|
2011-01-17 15:06:54 +01:00
|
|
|
: new SwUndoDrawDelete( (sal_uInt16)rMrkList.GetMarkCount() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
// Destroy ContactObjects, save formats.
|
2000-09-18 23:08:29 +00:00
|
|
|
for( i = 0; i < rMrkList.GetMarkCount(); ++i )
|
|
|
|
{
|
2001-11-13 12:52:46 +00:00
|
|
|
const SdrMark& rMark = *rMrkList.GetMark( i );
|
2006-07-25 11:29:31 +00:00
|
|
|
pObj = rMark.GetMarkedSdrObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwDrawContact *pContact = (SwDrawContact*)pObj->GetUserCall();
|
2011-11-25 00:45:15 +01:00
|
|
|
if( pContact ) // of course not for grouped objects
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
|
2011-01-28 11:31:24 +00:00
|
|
|
// before delete of selection is performed, marked
|
|
|
|
// <SwDrawVirtObj>-objects have to be replaced by its
|
|
|
|
// reference objects. Thus, assert, if a
|
|
|
|
// <SwDrawVirt>-object is found in the mark list.
|
2003-07-04 12:19:16 +00:00
|
|
|
if ( pObj->ISA(SwDrawVirtObj) )
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDrawVirtObj> is still marked for delete. application will crash!" );
|
2003-07-04 12:19:16 +00:00
|
|
|
}
|
2011-11-25 00:45:15 +01:00
|
|
|
// Deletes itself!
|
2003-11-24 15:01:11 +00:00
|
|
|
pContact->Changed(*pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
|
2000-09-18 23:08:29 +00:00
|
|
|
pObj->SetUserCall( 0 );
|
|
|
|
|
|
|
|
if( pUndo )
|
2001-11-13 12:52:46 +00:00
|
|
|
pUndo->AddObj( i, pFmt, rMark );
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
DelFrmFmt( pFmt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pUndo )
|
2010-11-25 14:31:08 +01:00
|
|
|
{
|
|
|
|
GetIDocumentUndoRedo().AppendUndo( pUndo );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallBase = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
SetModified();
|
|
|
|
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return bCallBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwDoc::DeleteSelection()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
_ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt32 nArrOrdNum )
|
2000-09-18 23:08:29 +00:00
|
|
|
: pFmt( pFrmFmt ), pAnchor( pFlyAn ), nOrdNum( nArrOrdNum )
|
|
|
|
{
|
2003-04-24 13:53:49 +00:00
|
|
|
// #i11176#
|
|
|
|
// This also needs to work when no layout exists. Thus, for
|
|
|
|
// FlyFrames an alternative method is used now in that case.
|
|
|
|
if( RES_FLYFRMFMT == pFmt->Which() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
// See if there is an SdrObject for it
|
2010-12-17 09:02:23 +01:00
|
|
|
SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFrmFmt );
|
|
|
|
if( pFly )
|
|
|
|
nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2003-04-24 13:53:49 +00:00
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
// See if there is an SdrObject for it
|
2010-12-17 09:02:23 +01:00
|
|
|
SwFlyDrawContact* pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *pFrmFmt );
|
|
|
|
if( pContact )
|
|
|
|
nOrdNum = pContact->GetMaster()->GetOrdNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2003-04-24 13:53:49 +00:00
|
|
|
else if( RES_DRAWFRMFMT == pFmt->Which() )
|
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
// See if there is an SdrObject for it
|
2010-12-17 09:02:23 +01:00
|
|
|
SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
|
|
|
|
if( pContact )
|
|
|
|
nOrdNum = pContact->GetMaster()->GetOrdNum();
|
2003-04-24 13:53:49 +00:00
|
|
|
}
|
2008-04-22 13:56:45 +00:00
|
|
|
else {
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !this, "was ist das fuer ein Format?" );
|
2008-04-22 13:56:45 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************/
|
2011-11-25 00:45:15 +01:00
|
|
|
// Is also called by the Sw3 Reader, if there was an error when reading the
|
|
|
|
// drawing layer. If it is called by the Sw3 Reader the layer is rebuilt
|
|
|
|
// from scratch.
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2001-10-08 12:32:31 +00:00
|
|
|
#include <svx/sxenditm.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void SwDoc::InitDrawModel()
|
|
|
|
{
|
2001-07-31 15:51:57 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::InitDrawModel" );
|
2001-07-23 16:20:51 +00:00
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
// !! Attention: there is similar code in the Sw3 Reader (sw3imp.cxx) that
|
|
|
|
// also has to be maintained!!
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pDrawModel )
|
|
|
|
ReleaseDrawModel();
|
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
// Setup DrawPool and EditEnginePool. Ownership is ours and only gets passed
|
|
|
|
// to the Drawing.
|
|
|
|
// The pools are destroyed in the ReleaseDrawModel.
|
2011-02-07 20:21:18 +01:00
|
|
|
// for loading the drawing items. This must be loaded without RefCounts!
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
|
2011-02-07 20:21:18 +01:00
|
|
|
// change DefaultItems for the SdrEdgeObj distance items to TWIPS.
|
2001-10-08 12:32:31 +00:00
|
|
|
if(pSdrPool)
|
|
|
|
{
|
|
|
|
const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
|
2004-10-12 08:59:00 +00:00
|
|
|
|
|
|
|
// #i33700#
|
|
|
|
// Set shadow distance defaults as PoolDefaultItems. Details see bug.
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
|
|
|
|
pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
|
2001-10-08 12:32:31 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
pSdrPool->SetSecondaryPool( pEEgPool );
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
if ( !GetAttrPool().GetFrozenIdRanges () )
|
|
|
|
GetAttrPool().FreezeIdRanges();
|
2001-02-20 15:15:10 +00:00
|
|
|
else
|
|
|
|
pSdrPool->FreezeIdRanges();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-02-07 20:21:18 +01:00
|
|
|
// set FontHeight pool defaults without changing static SdrEngineDefaults
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
|
2001-11-27 09:12:49 +00:00
|
|
|
|
2001-07-23 16:20:51 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create DrawDocument" );
|
2011-11-25 00:45:15 +01:00
|
|
|
// The document owns the SdrModel. We always have two layers and one page.
|
2000-09-18 23:08:29 +00:00
|
|
|
pDrawModel = new SwDrawDocument( this );
|
|
|
|
|
2010-11-25 14:31:08 +01:00
|
|
|
pDrawModel->EnableUndo( GetIDocumentUndoRedo().DoesUndo() );
|
2009-06-04 16:21:29 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
String sLayerNm;
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Hell" ));
|
|
|
|
nHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Heaven" ));
|
|
|
|
nHeaven = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
|
|
|
|
nControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// add invisible layers corresponding to the visible ones.
|
2003-07-04 12:19:16 +00:00
|
|
|
{
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
|
|
|
|
nInvisibleHell = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
|
|
|
|
nInvisibleHeaven = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
|
|
|
|
nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
|
|
|
|
}
|
|
|
|
|
2011-02-09 15:55:27 +01:00
|
|
|
SdrPage* pMasterPage = pDrawModel->AllocPage( sal_False );
|
2010-06-13 15:22:56 +02:00
|
|
|
pDrawModel->InsertPage( pMasterPage );
|
2001-07-23 16:20:51 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" );
|
|
|
|
|
|
|
|
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" );
|
2000-09-18 23:08:29 +00:00
|
|
|
SdrOutliner& rOutliner = pDrawModel->GetDrawOutliner();
|
2000-10-27 10:55:57 +00:00
|
|
|
uno::Reference< XSpellChecker1 > xSpell = ::GetSpellChecker();
|
2000-09-18 23:08:29 +00:00
|
|
|
rOutliner.SetSpeller( xSpell );
|
2001-10-18 17:16:15 +00:00
|
|
|
uno::Reference<XHyphenator> xHyphenator( ::GetHyphenator() );
|
|
|
|
rOutliner.SetHyphenator( xHyphenator );
|
2001-07-23 16:20:51 +00:00
|
|
|
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create Spellchecker/Hyphenator" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SetCalcFieldValueHdl(&rOutliner);
|
|
|
|
SetCalcFieldValueHdl(&pDrawModel->GetHitTestOutliner());
|
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
// Set the LinkManager in the model so that linked graphics can be inserted.
|
|
|
|
// The WinWord import needs it too.
|
2000-09-18 23:08:29 +00:00
|
|
|
pDrawModel->SetLinkManager( &GetLinkManager() );
|
2006-08-14 14:56:41 +00:00
|
|
|
pDrawModel->SetAddExtLeading( get(IDocumentSettingAccess::ADD_EXT_LEADING) );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2006-08-14 14:56:41 +00:00
|
|
|
OutputDevice* pRefDev = getReferenceDevice( false );
|
2003-04-01 08:52:49 +00:00
|
|
|
if ( pRefDev )
|
|
|
|
pDrawModel->SetRefDevice( pRefDev );
|
2003-10-15 08:54:16 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
pDrawModel->SetNotifyUndoActionHdl( LINK( this, SwDoc, AddDrawUndo ));
|
2010-06-13 15:22:56 +02:00
|
|
|
if ( pCurrentView )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
ViewShell* pViewSh = pCurrentView;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
SwRootFrm* pRoot = pViewSh->GetLayout();
|
|
|
|
if( pRoot && !pRoot->GetDrawPage() )
|
|
|
|
{
|
|
|
|
// Disable "multiple layout" for the moment:
|
|
|
|
// use pMasterPage instead of a new created SdrPage
|
|
|
|
// pDrawModel->AllocPage( FALSE );
|
|
|
|
// pDrawModel->InsertPage( pDrawPage );
|
|
|
|
SdrPage* pDrawPage = pMasterPage;
|
|
|
|
pRoot->SetDrawPage( pDrawPage );
|
|
|
|
pDrawPage->SetSize( pRoot->Frm().SSize() );
|
|
|
|
}
|
|
|
|
pViewSh = (ViewShell*)pViewSh->GetNext();
|
|
|
|
}while( pViewSh != pCurrentView );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-12-06 03:27:48 +01:00
|
|
|
|
|
|
|
UpdateDrawDefaults();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
/** method to notify drawing page view about the invisible layers */
|
2003-07-04 12:19:16 +00:00
|
|
|
void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
|
|
|
|
{
|
|
|
|
String sLayerNm;
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
|
2011-01-17 15:06:54 +01:00
|
|
|
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
|
2003-07-04 12:19:16 +00:00
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
|
2011-01-17 15:06:54 +01:00
|
|
|
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
|
2003-07-04 12:19:16 +00:00
|
|
|
|
|
|
|
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
|
2011-01-17 15:06:54 +01:00
|
|
|
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
|
2003-07-04 12:19:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** method to determine, if a layer ID belongs to the visible ones.
|
|
|
|
|
|
|
|
Note: If given layer ID is unknown, method asserts and returns <false>.
|
|
|
|
*/
|
2004-02-26 14:26:35 +00:00
|
|
|
bool SwDoc::IsVisibleLayerId( const SdrLayerID& _nLayerId ) const
|
2003-07-04 12:19:16 +00:00
|
|
|
{
|
|
|
|
bool bRetVal;
|
|
|
|
|
|
|
|
if ( _nLayerId == GetHeavenId() ||
|
|
|
|
_nLayerId == GetHellId() ||
|
|
|
|
_nLayerId == GetControlsId() )
|
|
|
|
{
|
|
|
|
bRetVal = true;
|
|
|
|
}
|
|
|
|
else if ( _nLayerId == GetInvisibleHeavenId() ||
|
|
|
|
_nLayerId == GetInvisibleHellId() ||
|
|
|
|
_nLayerId == GetInvisibleControlsId() )
|
|
|
|
{
|
|
|
|
bRetVal = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDoc::IsVisibleLayerId(..)> - unknown layer ID." );
|
2003-07-04 12:19:16 +00:00
|
|
|
bRetVal = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRetVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** method to determine, if the corresponding visible layer ID for a invisible one.
|
|
|
|
|
|
|
|
Note: If given layer ID is a visible one, method returns given layer ID.
|
|
|
|
Note: If given layer ID is unknown, method returns given layer ID.
|
|
|
|
*/
|
|
|
|
SdrLayerID SwDoc::GetVisibleLayerIdByInvisibleOne( const SdrLayerID& _nInvisibleLayerId )
|
|
|
|
{
|
|
|
|
SdrLayerID nVisibleLayerId;
|
|
|
|
|
|
|
|
if ( _nInvisibleLayerId == GetInvisibleHeavenId() )
|
|
|
|
{
|
|
|
|
nVisibleLayerId = GetHeavenId();
|
|
|
|
}
|
|
|
|
else if ( _nInvisibleLayerId == GetInvisibleHellId() )
|
|
|
|
{
|
|
|
|
nVisibleLayerId = GetHellId();
|
|
|
|
}
|
|
|
|
else if ( _nInvisibleLayerId == GetInvisibleControlsId() )
|
|
|
|
{
|
|
|
|
nVisibleLayerId = GetControlsId();
|
|
|
|
}
|
|
|
|
else if ( _nInvisibleLayerId == GetHeavenId() ||
|
|
|
|
_nInvisibleLayerId == GetHellId() ||
|
|
|
|
_nInvisibleLayerId == GetControlsId() )
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID already an invisible one." );
|
2003-07-04 12:19:16 +00:00
|
|
|
nVisibleLayerId = _nInvisibleLayerId;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDoc::GetVisibleLayerIdByInvisibleOne(..)> - given layer ID is unknown." );
|
2003-07-04 12:19:16 +00:00
|
|
|
nVisibleLayerId = _nInvisibleLayerId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nVisibleLayerId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** method to determine, if the corresponding invisible layer ID for a visible one.
|
|
|
|
|
|
|
|
Note: If given layer ID is a invisible one, method returns given layer ID.
|
|
|
|
Note: If given layer ID is unknown, method returns given layer ID.
|
|
|
|
*/
|
|
|
|
SdrLayerID SwDoc::GetInvisibleLayerIdByVisibleOne( const SdrLayerID& _nVisibleLayerId )
|
|
|
|
{
|
|
|
|
SdrLayerID nInvisibleLayerId;
|
|
|
|
|
|
|
|
if ( _nVisibleLayerId == GetHeavenId() )
|
|
|
|
{
|
|
|
|
nInvisibleLayerId = GetInvisibleHeavenId();
|
|
|
|
}
|
|
|
|
else if ( _nVisibleLayerId == GetHellId() )
|
|
|
|
{
|
|
|
|
nInvisibleLayerId = GetInvisibleHellId();
|
|
|
|
}
|
|
|
|
else if ( _nVisibleLayerId == GetControlsId() )
|
|
|
|
{
|
|
|
|
nInvisibleLayerId = GetInvisibleControlsId();
|
|
|
|
}
|
|
|
|
else if ( _nVisibleLayerId == GetInvisibleHeavenId() ||
|
|
|
|
_nVisibleLayerId == GetInvisibleHellId() ||
|
|
|
|
_nVisibleLayerId == GetInvisibleControlsId() )
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID already an invisible one." );
|
2003-07-04 12:19:16 +00:00
|
|
|
nInvisibleLayerId = _nVisibleLayerId;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<SwDoc::GetInvisibleLayerIdByVisibleOne(..)> - given layer ID is unknown." );
|
2003-07-04 12:19:16 +00:00
|
|
|
nInvisibleLayerId = _nVisibleLayerId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nInvisibleLayerId;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwDoc::ReleaseDrawModel()
|
|
|
|
{
|
|
|
|
if ( pDrawModel )
|
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
// !! Also maintain the code in the sw3io for inserting documents!!
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
delete pDrawModel; pDrawModel = 0;
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
OSL_ENSURE( pSdrPool, "missing pool" );
|
2000-09-18 23:08:29 +00:00
|
|
|
SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
|
2011-11-25 00:45:15 +01:00
|
|
|
OSL_ENSURE( !pEEgPool->GetSecondaryPool(), "I don't accept additional pools");
|
|
|
|
pSdrPool->Delete(); // First have the items destroyed,
|
|
|
|
// then destroy the chain!
|
|
|
|
GetAttrPool().SetSecondaryPool( 0 ); // This one's a must!
|
|
|
|
pSdrPool->SetSecondaryPool( 0 ); // That one's safer
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
SfxItemPool::Free(pSdrPool);
|
|
|
|
SfxItemPool::Free(pEEgPool);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SdrModel* SwDoc::_MakeDrawModel()
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pDrawModel, "_MakeDrawModel: Why?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
InitDrawModel();
|
2010-06-13 15:22:56 +02:00
|
|
|
if ( pCurrentView )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
ViewShell* pTmp = pCurrentView;
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
{
|
|
|
|
pTmp->MakeDrawView();
|
|
|
|
pTmp = (ViewShell*) pTmp->GetNext();
|
2010-06-13 15:22:56 +02:00
|
|
|
} while ( pTmp != pCurrentView );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-11-25 00:45:15 +01:00
|
|
|
// Broadcast, so that the FormShell can be connected to the DrawView
|
2000-09-18 23:08:29 +00:00
|
|
|
if( GetDocShell() )
|
|
|
|
{
|
|
|
|
SfxSimpleHint aHnt( SW_BROADCAST_DRAWVIEWS_CREATED );
|
|
|
|
GetDocShell()->Broadcast( aHnt );
|
|
|
|
}
|
2010-06-13 15:22:56 +02:00
|
|
|
} //swmod 071029//swmod 071225
|
2000-09-18 23:08:29 +00:00
|
|
|
return pDrawModel;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
void SwDoc::DrawNotifyUndoHdl()
|
|
|
|
{
|
|
|
|
pDrawModel->SetNotifyUndoActionHdl( Link() );
|
|
|
|
}
|
|
|
|
|
2004-06-16 08:36:11 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2011-11-25 00:45:15 +01:00
|
|
|
* In the Outliner, set a link to the method for field display in edit objects.
|
2004-06-16 08:36:11 +00:00
|
|
|
*
|
|
|
|
*************************************************************************/
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void SwDoc::SetCalcFieldValueHdl(Outliner* pOutliner)
|
|
|
|
{
|
|
|
|
pOutliner->SetCalcFieldValueHdl(LINK(this, SwDoc, CalcFieldValueHdl));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
2011-11-25 00:45:15 +01:00
|
|
|
|* Recognise fields/URLs in the Outliner and set how they are displayed.
|
2000-09-18 23:08:29 +00:00
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo)
|
|
|
|
{
|
|
|
|
if (pInfo)
|
|
|
|
{
|
|
|
|
const SvxFieldItem& rField = pInfo->GetField();
|
|
|
|
const SvxFieldData* pField = rField.GetField();
|
|
|
|
|
|
|
|
if (pField && pField->ISA(SvxDateField))
|
|
|
|
{
|
|
|
|
/******************************************************************
|
2011-11-25 00:45:15 +01:00
|
|
|
* Date field
|
2000-09-18 23:08:29 +00:00
|
|
|
******************************************************************/
|
|
|
|
pInfo->SetRepresentation(
|
2001-06-13 12:52:57 +00:00
|
|
|
((const SvxDateField*) pField)->GetFormatted(
|
2011-01-17 15:06:54 +01:00
|
|
|
*GetNumberFormatter( sal_True ), LANGUAGE_SYSTEM) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if (pField && pField->ISA(SvxURLField))
|
|
|
|
{
|
|
|
|
/******************************************************************
|
2011-11-25 00:45:15 +01:00
|
|
|
* URL field
|
2000-09-18 23:08:29 +00:00
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
switch ( ((const SvxURLField*) pField)->GetFormat() )
|
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
case SVXURLFORMAT_APPDEFAULT: //!!! Can be set in App???
|
2000-09-18 23:08:29 +00:00
|
|
|
case SVXURLFORMAT_REPR:
|
|
|
|
{
|
|
|
|
pInfo->SetRepresentation(
|
|
|
|
((const SvxURLField*)pField)->GetRepresentation());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SVXURLFORMAT_URL:
|
|
|
|
{
|
|
|
|
pInfo->SetRepresentation(
|
|
|
|
((const SvxURLField*)pField)->GetURL());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nChrFmt;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if (IsVisitedURL(((const SvxURLField*)pField)->GetURL()))
|
|
|
|
nChrFmt = RES_POOLCHR_INET_VISIT;
|
|
|
|
else
|
|
|
|
nChrFmt = RES_POOLCHR_INET_NORMAL;
|
|
|
|
|
|
|
|
SwFmt *pFmt = GetCharFmtFromPool(nChrFmt);
|
|
|
|
|
|
|
|
Color aColor(COL_LIGHTBLUE);
|
|
|
|
if (pFmt)
|
|
|
|
aColor = pFmt->GetColor().GetValue();
|
|
|
|
|
|
|
|
pInfo->SetTxtColor(aColor);
|
|
|
|
}
|
|
|
|
else if (pField && pField->ISA(SdrMeasureField))
|
|
|
|
{
|
|
|
|
/******************************************************************
|
2011-11-25 00:45:15 +01:00
|
|
|
* Measure field
|
2000-09-18 23:08:29 +00:00
|
|
|
******************************************************************/
|
|
|
|
pInfo->ClearFldColor();
|
|
|
|
}
|
2002-11-22 09:44:14 +00:00
|
|
|
else if ( pField && pField->ISA(SvxExtTimeField))
|
|
|
|
{
|
|
|
|
/******************************************************************
|
2011-11-25 00:45:15 +01:00
|
|
|
* Time field
|
2002-11-22 09:44:14 +00:00
|
|
|
******************************************************************/
|
|
|
|
pInfo->SetRepresentation(
|
|
|
|
((const SvxExtTimeField*) pField)->GetFormatted(
|
2011-01-17 15:06:54 +01:00
|
|
|
*GetNumberFormatter( sal_True ), LANGUAGE_SYSTEM) );
|
2002-11-22 09:44:14 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
2011-11-25 00:45:15 +01:00
|
|
|
OSL_FAIL("unknown field command");
|
2000-09-18 23:08:29 +00:00
|
|
|
pInfo->SetRepresentation( String( '?' ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
}
|
2006-03-22 11:22:53 +00:00
|
|
|
|
2006-08-14 14:56:41 +00:00
|
|
|
/* TFFDI: The functions formerly declared 'inline'
|
|
|
|
*/
|
|
|
|
const SdrModel* SwDoc::GetDrawModel() const { return pDrawModel; }
|
|
|
|
SdrModel* SwDoc::GetDrawModel() { return pDrawModel; }
|
|
|
|
SdrLayerID SwDoc::GetHeavenId() const { return nHeaven; }
|
|
|
|
SdrLayerID SwDoc::GetHellId() const { return nHell; }
|
|
|
|
SdrLayerID SwDoc::GetControlsId() const { return nControls; }
|
|
|
|
SdrLayerID SwDoc::GetInvisibleHeavenId() const { return nInvisibleHeaven; }
|
|
|
|
SdrLayerID SwDoc::GetInvisibleHellId() const { return nInvisibleHell; }
|
|
|
|
SdrLayerID SwDoc::GetInvisibleControlsId() const { return nInvisibleControls; }
|
|
|
|
SdrModel* SwDoc::GetOrCreateDrawModel() { return GetDrawModel() ? GetDrawModel() : _MakeDrawModel(); }
|
|
|
|
|
2011-01-28 11:31:24 +00:00
|
|
|
// #i62875#
|
2006-03-22 11:22:53 +00:00
|
|
|
namespace docfunc
|
|
|
|
{
|
|
|
|
bool ExistsDrawObjs( SwDoc& p_rDoc )
|
|
|
|
{
|
|
|
|
bool bExistsDrawObjs( false );
|
|
|
|
|
|
|
|
if ( p_rDoc.GetDrawModel() &&
|
|
|
|
p_rDoc.GetDrawModel()->GetPage( 0 ) )
|
|
|
|
{
|
|
|
|
const SdrPage& rSdrPage( *(p_rDoc.GetDrawModel()->GetPage( 0 )) );
|
|
|
|
|
|
|
|
SdrObjListIter aIter( rSdrPage, IM_FLAT );
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
{
|
|
|
|
SdrObject* pObj( aIter.Next() );
|
|
|
|
if ( !dynamic_cast<SwVirtFlyDrawObj*>(pObj) &&
|
|
|
|
!dynamic_cast<SwFlyDrawObj*>(pObj) )
|
|
|
|
{
|
|
|
|
bExistsDrawObjs = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bExistsDrawObjs;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AllDrawObjsOnPage( SwDoc& p_rDoc )
|
|
|
|
{
|
|
|
|
bool bAllDrawObjsOnPage( true );
|
|
|
|
|
|
|
|
if ( p_rDoc.GetDrawModel() &&
|
|
|
|
p_rDoc.GetDrawModel()->GetPage( 0 ) )
|
|
|
|
{
|
|
|
|
const SdrPage& rSdrPage( *(p_rDoc.GetDrawModel()->GetPage( 0 )) );
|
|
|
|
|
|
|
|
SdrObjListIter aIter( rSdrPage, IM_FLAT );
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
{
|
|
|
|
SdrObject* pObj( aIter.Next() );
|
|
|
|
if ( !dynamic_cast<SwVirtFlyDrawObj*>(pObj) &&
|
|
|
|
!dynamic_cast<SwFlyDrawObj*>(pObj) )
|
|
|
|
{
|
|
|
|
SwDrawContact* pDrawContact =
|
|
|
|
dynamic_cast<SwDrawContact*>(::GetUserCall( pObj ));
|
|
|
|
if ( pDrawContact )
|
|
|
|
{
|
|
|
|
SwAnchoredDrawObject* pAnchoredDrawObj =
|
|
|
|
dynamic_cast<SwAnchoredDrawObject*>(pDrawContact->GetAnchoredObj( pObj ));
|
|
|
|
|
|
|
|
// error handling
|
|
|
|
{
|
|
|
|
if ( !pAnchoredDrawObj )
|
|
|
|
{
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL( "<docfunc::AllDrawObjsOnPage() - missing anchored draw object" );
|
2006-03-22 11:22:53 +00:00
|
|
|
bAllDrawObjsOnPage = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pAnchoredDrawObj->NotYetPositioned() )
|
|
|
|
{
|
|
|
|
// The drawing object isn't yet layouted.
|
|
|
|
// Thus, it isn't known, if all drawing objects are on page.
|
|
|
|
bAllDrawObjsOnPage = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if ( pAnchoredDrawObj->IsOutsidePage() )
|
|
|
|
{
|
|
|
|
bAllDrawObjsOnPage = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// contact object of drawing object doesn't exists.
|
|
|
|
// Thus, the drawing object isn't yet positioned.
|
|
|
|
// Thus, it isn't known, if all drawing objects are on page.
|
|
|
|
bAllDrawObjsOnPage = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bAllDrawObjsOnPage;
|
|
|
|
}
|
|
|
|
}
|
2006-08-14 14:56:41 +00:00
|
|
|
|
2011-12-06 03:27:48 +01:00
|
|
|
void SwDoc::SetDrawDefaults()
|
|
|
|
{
|
|
|
|
mbSetDrawDefaults = true;
|
|
|
|
UpdateDrawDefaults();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwDoc::UpdateDrawDefaults()
|
|
|
|
{
|
|
|
|
// drawing layer defaults that are set for new documents (if InitNew was called)
|
|
|
|
if ( pDrawModel && mbSetDrawDefaults )
|
|
|
|
pDrawModel->SetDrawingLayerPoolDefaults();
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|