2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-09-16 20:24:43 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <hintids.hxx>
|
2008-03-05 16:03:53 +00:00
|
|
|
#include <hints.hxx>
|
2013-08-28 14:16:38 +02:00
|
|
|
#include <comphelper/flagguard.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <tools/bigint.hxx>
|
2012-11-23 17:51:16 +01:00
|
|
|
#include <tools/line.hxx>
|
2011-12-13 17:25:51 +01:00
|
|
|
#include <editeng/opaqitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/protitem.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <vcl/settings.hxx>
|
|
|
|
#include <vcl/outdev.hxx>
|
|
|
|
#include <fmtpdsc.hxx>
|
|
|
|
#include <fmtsrnd.hxx>
|
2001-03-02 10:21:22 +00:00
|
|
|
#include <pagedesc.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <pagefrm.hxx>
|
|
|
|
#include <rootfrm.hxx>
|
|
|
|
#include <cntfrm.hxx>
|
|
|
|
#include <ftnfrm.hxx>
|
|
|
|
#include <flyfrm.hxx>
|
|
|
|
#include <tabfrm.hxx>
|
2004-01-13 10:19:26 +00:00
|
|
|
#include <rowfrm.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <cellfrm.hxx>
|
|
|
|
#include <txtfrm.hxx>
|
|
|
|
#include <viewsh.hxx>
|
2004-09-08 15:10:36 +00:00
|
|
|
#include <viewopt.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <doc.hxx>
|
|
|
|
#include <viscrs.hxx>
|
|
|
|
#include <frmfmt.hxx>
|
|
|
|
#include <swtable.hxx>
|
|
|
|
#include <dflyobj.hxx>
|
|
|
|
#include <crstate.hxx>
|
|
|
|
#include <frmtool.hxx>
|
2004-02-26 14:31:21 +00:00
|
|
|
#include <ndtxt.hxx>
|
2011-06-29 10:38:19 +02:00
|
|
|
#include <dcontact.hxx>
|
2004-08-02 13:13:41 +00:00
|
|
|
#include <sortedobjs.hxx>
|
2013-03-19 13:41:19 +01:00
|
|
|
#include <txatbase.hxx>
|
|
|
|
#include <fmtfld.hxx>
|
|
|
|
#include <fldbas.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2006-11-14 14:11:38 +00:00
|
|
|
#include <cfloat>
|
2007-11-22 14:37:47 +00:00
|
|
|
#include <swselectionlist.hxx>
|
2006-11-14 14:11:38 +00:00
|
|
|
|
2012-11-23 17:51:16 +01:00
|
|
|
#include <basegfx/numeric/ftools.hxx>
|
|
|
|
|
2011-06-29 10:38:19 +02:00
|
|
|
namespace {
|
|
|
|
bool lcl_GetCrsrOfst_Objects( const SwPageFrm* pPageFrm, bool bSearchBackground,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS )
|
2011-06-29 10:38:19 +02:00
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
Point aPoint( rPoint );
|
|
|
|
SwOrderIter aIter( pPageFrm );
|
|
|
|
aIter.Top();
|
|
|
|
while ( aIter() )
|
|
|
|
{
|
|
|
|
const SwVirtFlyDrawObj* pObj =
|
|
|
|
static_cast<const SwVirtFlyDrawObj*>(aIter());
|
|
|
|
const SwAnchoredObject* pAnchoredObj = GetUserCall( aIter() )->GetAnchoredObj( aIter() );
|
|
|
|
const SwFmtSurround& rSurround = pAnchoredObj->GetFrmFmt().GetSurround();
|
2011-12-13 17:25:51 +01:00
|
|
|
const SvxOpaqueItem& rOpaque = pAnchoredObj->GetFrmFmt().GetOpaque();
|
|
|
|
bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT ) && !rOpaque.GetValue();
|
2011-06-29 10:38:19 +02:00
|
|
|
|
|
|
|
bool bBackgroundMatches = ( bInBackground && bSearchBackground ) ||
|
|
|
|
( !bInBackground && !bSearchBackground );
|
|
|
|
|
|
|
|
const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
|
|
|
|
if ( pFly && bBackgroundMatches &&
|
|
|
|
( ( pCMS ? pCMS->bSetInReadOnly : false ) ||
|
|
|
|
!pFly->IsProtected() ) &&
|
|
|
|
pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
|
|
|
|
{
|
|
|
|
bRet = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pCMS && pCMS->bStop )
|
|
|
|
return false;
|
|
|
|
aIter.Prev();
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
2011-08-26 17:10:51 +02:00
|
|
|
|
2012-11-23 17:51:16 +01:00
|
|
|
double lcl_getDistance( const SwRect& rRect, const Point& rPoint )
|
2011-08-26 17:10:51 +02:00
|
|
|
{
|
2012-11-23 17:51:16 +01:00
|
|
|
double nDist = 0.0;
|
2011-08-26 17:10:51 +02:00
|
|
|
|
2012-11-23 17:51:16 +01:00
|
|
|
// If the point is inside the rectangle, then distance is 0
|
|
|
|
// Otherwise, compute the distance to the center of the rectangle.
|
|
|
|
if ( !rRect.IsInside( rPoint ) )
|
|
|
|
{
|
|
|
|
Line aLine( rPoint, rRect.Center( ) );
|
|
|
|
nDist = aLine.GetLength( );
|
|
|
|
}
|
2011-08-26 17:10:51 +02:00
|
|
|
|
2012-11-23 17:51:16 +01:00
|
|
|
return nDist;
|
2011-08-26 17:10:51 +02:00
|
|
|
}
|
2011-06-29 10:38:19 +02:00
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//For SwFlyFrm::GetCrsrOfst
|
2000-09-18 23:08:29 +00:00
|
|
|
class SwCrsrOszControl
|
|
|
|
{
|
|
|
|
public:
|
2013-08-04 17:23:08 +02:00
|
|
|
// So the compiler can initialize the class already. No DTOR and member
|
|
|
|
// as public members
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFlyFrm *pEntry;
|
|
|
|
const SwFlyFrm *pStk1;
|
|
|
|
const SwFlyFrm *pStk2;
|
|
|
|
|
2012-11-30 08:49:55 +09:00
|
|
|
bool ChkOsz( const SwFlyFrm *pFly )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-11-30 08:49:55 +09:00
|
|
|
bool bRet = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pFly != pStk1 && pFly != pStk2 )
|
|
|
|
{
|
|
|
|
pStk1 = pStk2;
|
|
|
|
pStk2 = pFly;
|
2012-11-30 08:49:55 +09:00
|
|
|
bRet = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
2013-09-26 11:22:00 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void Entry( const SwFlyFrm *pFly )
|
|
|
|
{
|
|
|
|
if ( !pEntry )
|
|
|
|
pEntry = pStk1 = pFly;
|
|
|
|
}
|
2013-09-26 11:22:00 +02:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void Exit( const SwFlyFrm *pFly )
|
|
|
|
{
|
|
|
|
if ( pFly == pEntry )
|
|
|
|
pEntry = pStk1 = pStk2 = 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Searches the CntntFrm owning the PrtArea containing the point. */
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwCrsrMoveState* pCMS, bool ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrm *pFrm = Lower();
|
|
|
|
while ( !bRet && pFrm )
|
2004-08-02 13:13:41 +00:00
|
|
|
{
|
|
|
|
pFrm->Calc();
|
2005-10-18 12:48:43 +00:00
|
|
|
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i43742# New function
|
2005-10-18 12:48:43 +00:00
|
|
|
const bool bCntntCheck = pFrm->IsTxtFrm() && pCMS && pCMS->bCntntCheck;
|
|
|
|
const SwRect aPaintRect( bCntntCheck ?
|
|
|
|
pFrm->UnionFrm() :
|
|
|
|
pFrm->PaintArea() );
|
|
|
|
|
2000-11-09 13:03:01 +00:00
|
|
|
if ( aPaintRect.IsInside( rPoint ) &&
|
2005-10-18 12:48:43 +00:00
|
|
|
( bCntntCheck || pFrm->GetCrsrOfst( pPos, rPoint, pCMS ) ) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
if ( pCMS && pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Searches the page containing the searched point. */
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwCrsrMoveState* pCMS, bool bTestBackground ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2008-03-07 13:58:13 +00:00
|
|
|
Point aPoint( rPoint );
|
|
|
|
|
|
|
|
// check, if we have to adjust the point
|
|
|
|
if ( !Frm().IsInside( aPoint ) )
|
2001-10-19 09:32:09 +00:00
|
|
|
{
|
2013-04-11 00:21:40 -03:00
|
|
|
aPoint.X() = std::max( aPoint.X(), Frm().Left() );
|
|
|
|
aPoint.X() = std::min( aPoint.X(), Frm().Right() );
|
|
|
|
aPoint.Y() = std::max( aPoint.Y(), Frm().Top() );
|
|
|
|
aPoint.Y() = std::min( aPoint.Y(), Frm().Bottom() );
|
2008-03-07 13:58:13 +00:00
|
|
|
}
|
2001-10-19 09:32:09 +00:00
|
|
|
|
2011-08-26 17:10:51 +02:00
|
|
|
sal_Bool bTextRet, bBackRet = sal_False;
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Could it be a free flying one?
|
|
|
|
//If his content should be protected, we can't set the Crsr in it, thus
|
|
|
|
//all changes should be impossible.
|
2011-05-07 20:48:54 +02:00
|
|
|
if ( GetSortedObjs() )
|
2008-03-07 13:58:13 +00:00
|
|
|
{
|
2012-11-23 17:51:16 +01:00
|
|
|
bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS );
|
2008-03-07 13:58:13 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-03-07 13:58:13 +00:00
|
|
|
if ( !bRet )
|
|
|
|
{
|
2011-08-26 17:10:51 +02:00
|
|
|
SwPosition aBackPos( *pPos );
|
|
|
|
SwPosition aTextPos( *pPos );
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//We fix the StartPoint if no Cntnt below the page 'answers' and then
|
|
|
|
//start all over again one page before the current one.
|
|
|
|
//However we cant use Flys in such a case.
|
2011-08-26 17:10:51 +02:00
|
|
|
if ( SwLayoutFrm::GetCrsrOfst( &aTextPos, aPoint, pCMS ) )
|
|
|
|
{
|
|
|
|
bTextRet = sal_True;
|
|
|
|
}
|
2011-05-07 20:48:54 +02:00
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-05-07 20:48:54 +02:00
|
|
|
if ( pCMS && (pCMS->bStop || pCMS->bExactOnly) )
|
2008-03-07 13:58:13 +00:00
|
|
|
{
|
2011-05-07 20:48:54 +02:00
|
|
|
((SwCrsrMoveState*)pCMS)->bStop = sal_True;
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
const SwCntntFrm *pCnt = GetCntntPos( aPoint, sal_False, sal_False, sal_False, pCMS, sal_False );
|
|
|
|
if ( pCMS && pCMS->bStop )
|
|
|
|
return sal_False;
|
|
|
|
|
|
|
|
OSL_ENSURE( pCnt, "Crsr is gone to a Black hole" );
|
|
|
|
if( pCMS && pCMS->pFill && pCnt->IsTxtFrm() )
|
2011-08-26 17:10:51 +02:00
|
|
|
bTextRet = pCnt->GetCrsrOfst( &aTextPos, rPoint, pCMS );
|
2011-05-07 20:48:54 +02:00
|
|
|
else
|
2011-08-26 17:10:51 +02:00
|
|
|
bTextRet = pCnt->GetCrsrOfst( &aTextPos, aPoint, pCMS );
|
2011-03-23 18:05:38 +01:00
|
|
|
|
2011-08-26 17:10:51 +02:00
|
|
|
if ( !bTextRet )
|
2011-05-07 20:48:54 +02:00
|
|
|
{
|
|
|
|
// Set point to pCnt, delete mark
|
|
|
|
// this may happen, if pCnt is hidden
|
2011-08-26 17:10:51 +02:00
|
|
|
aTextPos = SwPosition( *pCnt->GetNode(), SwIndex( (SwTxtNode*)pCnt->GetNode(), 0 ) );
|
|
|
|
bTextRet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2008-03-07 13:58:13 +00:00
|
|
|
|
2013-06-10 14:48:59 +02:00
|
|
|
SwCntntNode* pTextNd = aTextPos.nNode.GetNode( ).GetCntntNode( );
|
|
|
|
bool bConsiderBackground = true;
|
|
|
|
// If the text position is a clickable field, then that should have priority.
|
|
|
|
if (pTextNd && pTextNd->IsTxtNode())
|
|
|
|
{
|
|
|
|
SwTxtNode* pTxtNd = pTextNd->GetTxtNode();
|
|
|
|
SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(aTextPos.nContent.GetIndex(), RES_TXTATR_FIELD);
|
|
|
|
if (pTxtAttr)
|
|
|
|
{
|
2013-09-24 15:03:38 +00:00
|
|
|
const SwField* pField = pTxtAttr->GetFmtFld().GetField();
|
2013-06-10 14:48:59 +02:00
|
|
|
if (pField->IsClickable())
|
|
|
|
bConsiderBackground = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-26 17:10:51 +02:00
|
|
|
// Check objects in the background if nothing else matched
|
|
|
|
if ( GetSortedObjs() )
|
|
|
|
{
|
2012-11-23 17:51:16 +01:00
|
|
|
bBackRet = lcl_GetCrsrOfst_Objects( this, true, &aBackPos, rPoint, pCMS );
|
2011-08-26 17:10:51 +02:00
|
|
|
}
|
|
|
|
|
2013-06-10 14:48:59 +02:00
|
|
|
if ( ( bConsiderBackground && bTestBackground && bBackRet ) || !bTextRet )
|
2011-08-26 17:10:51 +02:00
|
|
|
{
|
|
|
|
bRet = bBackRet;
|
2012-12-13 01:28:59 +01:00
|
|
|
(*pPos) = aBackPos;
|
|
|
|
}
|
|
|
|
else if (bTextRet && !bBackRet)
|
|
|
|
{
|
|
|
|
bRet = bTextRet;
|
|
|
|
(*pPos) = aTextPos;
|
2011-08-26 17:10:51 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-23 17:51:16 +01:00
|
|
|
/* In order to provide a selection as accurable as possible when we have both
|
|
|
|
* text and brackground object, then we compute the distance between both
|
|
|
|
* would-be positions and the click point. The shortest distance wins.
|
|
|
|
*/
|
|
|
|
double nTextDistance = 0;
|
|
|
|
bool bValidTextDistance = false;
|
|
|
|
if ( pTextNd )
|
|
|
|
{
|
|
|
|
SwCntntFrm* pTextFrm = pTextNd->getLayoutFrm( getRootFrm( ) );
|
|
|
|
|
2013-08-28 14:16:38 +02:00
|
|
|
// try this again but prefer the "previous" position
|
|
|
|
SwCrsrMoveState aMoveState;
|
|
|
|
SwCrsrMoveState *const pState((pCMS) ? pCMS : &aMoveState);
|
|
|
|
comphelper::FlagRestorationGuard g(
|
|
|
|
pState->bPosMatchesBounds, true);
|
|
|
|
SwPosition prevTextPos(*pPos);
|
|
|
|
SwLayoutFrm::GetCrsrOfst(&prevTextPos, aPoint, pState);
|
|
|
|
|
|
|
|
SwRect aTextRect;
|
|
|
|
pTextFrm->GetCharRect(aTextRect, prevTextPos);
|
|
|
|
|
|
|
|
if (prevTextPos.nContent < pTextNd->Len())
|
|
|
|
{
|
|
|
|
// aRextRect is just a line on the left edge of the
|
|
|
|
// previous character; to get a better measure from
|
|
|
|
// lcl_getDistance, extend that to a rectangle over
|
|
|
|
// the entire character.
|
|
|
|
SwPosition const nextTextPos(prevTextPos.nNode,
|
|
|
|
SwIndex(prevTextPos.nContent, +1));
|
|
|
|
SwRect nextTextRect;
|
|
|
|
pTextFrm->GetCharRect(nextTextRect, nextTextPos);
|
|
|
|
SWRECTFN(pTextFrm);
|
|
|
|
if ((aTextRect.*fnRect->fnGetTop)() ==
|
|
|
|
(nextTextRect.*fnRect->fnGetTop)()) // same line?
|
|
|
|
{
|
|
|
|
// need to handle mixed RTL/LTR portions somehow
|
|
|
|
if ((aTextRect.*fnRect->fnGetLeft)() <
|
|
|
|
(nextTextRect.*fnRect->fnGetLeft)())
|
|
|
|
{
|
|
|
|
(aTextRect.*fnRect->fnSetRight)(
|
|
|
|
(nextTextRect.*fnRect->fnGetLeft)());
|
|
|
|
}
|
|
|
|
else // RTL
|
|
|
|
{
|
|
|
|
(aTextRect.*fnRect->fnSetLeft)(
|
|
|
|
(nextTextRect.*fnRect->fnGetLeft)());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nTextDistance = lcl_getDistance(aTextRect, rPoint);
|
2012-11-23 17:51:16 +01:00
|
|
|
bValidTextDistance = true;
|
2013-03-19 13:41:19 +01:00
|
|
|
}
|
|
|
|
|
2012-11-23 17:51:16 +01:00
|
|
|
double nBackDistance = 0;
|
|
|
|
bool bValidBackDistance = false;
|
|
|
|
SwCntntNode* pBackNd = aBackPos.nNode.GetNode( ).GetCntntNode( );
|
2013-03-19 13:41:19 +01:00
|
|
|
if ( pBackNd && bConsiderBackground)
|
2012-11-23 17:51:16 +01:00
|
|
|
{
|
|
|
|
// FIXME There are still cases were we don't have the proper node here.
|
|
|
|
SwCntntFrm* pBackFrm = pBackNd->getLayoutFrm( getRootFrm( ) );
|
|
|
|
SwRect rBackRect;
|
2012-12-03 22:08:26 +01:00
|
|
|
if (pBackFrm)
|
|
|
|
{
|
|
|
|
pBackFrm->GetCharRect( rBackRect, aBackPos );
|
2012-11-23 17:51:16 +01:00
|
|
|
|
2012-12-03 22:08:26 +01:00
|
|
|
nBackDistance = lcl_getDistance( rBackRect, rPoint );
|
|
|
|
bValidBackDistance = true;
|
|
|
|
}
|
2012-11-23 17:51:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( bValidTextDistance && bValidBackDistance && basegfx::fTools::more( nTextDistance, nBackDistance ) )
|
|
|
|
{
|
|
|
|
bRet = bBackRet;
|
2012-12-13 01:28:59 +01:00
|
|
|
(*pPos) = aBackPos;
|
2012-11-23 17:51:16 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bRet = bTextRet;
|
2012-12-13 01:28:59 +01:00
|
|
|
(*pPos) = aTextPos;
|
2012-11-23 17:51:16 +01:00
|
|
|
}
|
2011-08-26 17:10:51 +02:00
|
|
|
}
|
2011-06-29 10:38:19 +02:00
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bRet )
|
|
|
|
rPoint = aPoint;
|
2008-03-07 13:58:13 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2007-11-22 14:37:47 +00:00
|
|
|
bool SwLayoutFrm::FillSelection( SwSelectionList& rList, const SwRect& rRect ) const
|
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
if( rRect.IsOver(PaintArea()) )
|
|
|
|
{
|
|
|
|
const SwFrm* pFrm = Lower();
|
|
|
|
while( pFrm )
|
|
|
|
{
|
|
|
|
pFrm->FillSelection( rList, rRect );
|
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SwPageFrm::FillSelection( SwSelectionList& rList, const SwRect& rRect ) const
|
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
if( rRect.IsOver(PaintArea()) )
|
|
|
|
{
|
|
|
|
bRet = SwLayoutFrm::FillSelection( rList, rRect );
|
|
|
|
if( GetSortedObjs() )
|
|
|
|
{
|
|
|
|
const SwSortedObjs &rObjs = *GetSortedObjs();
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
|
2007-11-22 14:37:47 +00:00
|
|
|
{
|
|
|
|
const SwAnchoredObject* pAnchoredObj = rObjs[i];
|
|
|
|
if( !pAnchoredObj->ISA(SwFlyFrm) )
|
|
|
|
continue;
|
|
|
|
const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
|
|
|
|
if( pFly->FillSelection( rList, rRect ) )
|
|
|
|
bRet = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) const
|
|
|
|
{
|
|
|
|
const SwFrm *pPage = Lower();
|
|
|
|
const long nBottom = rRect.Bottom();
|
|
|
|
while( pPage )
|
|
|
|
{
|
|
|
|
if( pPage->Frm().Top() < nBottom )
|
|
|
|
{
|
|
|
|
if( pPage->Frm().Bottom() > rRect.Top() )
|
|
|
|
pPage->FillSelection( aSelList, rRect );
|
|
|
|
pPage = pPage->GetNext();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pPage = 0;
|
|
|
|
}
|
|
|
|
return !aSelList.isEmpty();
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Primary passes the call to the first page.
|
|
|
|
*
|
|
|
|
* @return sal_False, if the passed Point gets changed
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwCrsrMoveState* pCMS, bool bTestBackground ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-02-14 08:52:23 +00:00
|
|
|
sal_Bool bOldAction = IsCallbackActionEnabled();
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwRootFrm*)this)->SetCallbackActionEnabled( sal_False );
|
2013-08-04 17:23:08 +02:00
|
|
|
OSL_ENSURE( (Lower() && Lower()->IsPageFrm()), "No PageFrm found." );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pCMS && pCMS->pFill )
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwCrsrMoveState*)pCMS)->bFillRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
Point aOldPoint = rPoint;
|
2008-03-07 13:58:13 +00:00
|
|
|
|
|
|
|
// search for page containing rPoint. The borders around the pages are considerd
|
|
|
|
const SwPageFrm* pPage = GetPageAtPos( rPoint, 0, true );
|
|
|
|
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i95626#
|
2009-01-21 14:36:52 +00:00
|
|
|
// special handling for <rPoint> beyond root frames area
|
|
|
|
if ( !pPage &&
|
|
|
|
rPoint.X() > Frm().Right() &&
|
|
|
|
rPoint.Y() > Frm().Bottom() )
|
|
|
|
{
|
|
|
|
pPage = dynamic_cast<const SwPageFrm*>(Lower());
|
|
|
|
while ( pPage && pPage->GetNext() )
|
|
|
|
{
|
|
|
|
pPage = dynamic_cast<const SwPageFrm*>(pPage->GetNext());
|
|
|
|
}
|
|
|
|
}
|
2008-03-07 13:58:13 +00:00
|
|
|
if ( pPage )
|
2009-01-21 14:36:52 +00:00
|
|
|
{
|
2012-11-23 17:51:16 +01:00
|
|
|
pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS, bTestBackground );
|
2009-01-21 14:36:52 +00:00
|
|
|
}
|
2008-03-07 13:58:13 +00:00
|
|
|
|
2001-02-14 08:52:23 +00:00
|
|
|
((SwRootFrm*)this)->SetCallbackActionEnabled( bOldAction );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pCMS )
|
|
|
|
{
|
|
|
|
if( pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pCMS->pFill )
|
|
|
|
return pCMS->bFillRet;
|
|
|
|
}
|
|
|
|
return aOldPoint == rPoint;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/**
|
|
|
|
* If this is about a Cntnt-carrying cell the Crsr will be force inserted into one of the CntntFrms
|
|
|
|
* if there are no other options.
|
|
|
|
*
|
|
|
|
* There is no entry for protected cells.
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwCrsrMoveState* pCMS, bool ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
// cell frame does not necessarily have a lower (split table cell)
|
|
|
|
if ( !Lower() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( !(pCMS?pCMS->bSetInReadOnly:sal_False) &&
|
2000-09-18 23:08:29 +00:00
|
|
|
GetFmt()->GetProtect().IsCntntProtected() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( pCMS && pCMS->eState == MV_TBLSEL )
|
|
|
|
{
|
|
|
|
const SwTabFrm *pTab = FindTabFrm();
|
2004-05-03 12:47:58 +00:00
|
|
|
if ( pTab->IsFollow() && pTab->IsInHeadline( *this ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwCrsrMoveState*)pCMS)->bStop = sal_True;
|
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-13 10:19:26 +00:00
|
|
|
if ( Lower() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
if ( Lower()->IsLayoutFrm() )
|
|
|
|
return SwLayoutFrm::GetCrsrOfst( pPos, rPoint, pCMS );
|
|
|
|
else
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
Calc();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2004-01-13 10:19:26 +00:00
|
|
|
|
|
|
|
const SwFrm *pFrm = Lower();
|
|
|
|
while ( pFrm && !bRet )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
pFrm->Calc();
|
|
|
|
if ( pFrm->Frm().IsInside( rPoint ) )
|
|
|
|
{
|
|
|
|
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
|
|
|
|
if ( pCMS && pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2004-01-13 10:19:26 +00:00
|
|
|
}
|
|
|
|
pFrm = pFrm->GetNext();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-01-13 10:19:26 +00:00
|
|
|
if ( !bRet )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
|
2011-01-17 15:06:54 +01:00
|
|
|
const SwCntntFrm *pCnt = GetCntntPos( rPoint, sal_True );
|
2004-01-13 10:19:26 +00:00
|
|
|
if( pPoint && pCnt->IsTxtFrm() )
|
|
|
|
{
|
|
|
|
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
|
|
|
|
rPoint = *pPoint;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
|
|
|
|
delete pPoint;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2004-01-13 10:19:26 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Problem: If two Flys have the same size and share the same position then
|
|
|
|
//they end inside each other.
|
|
|
|
//Because we recursively check if a Point doesn't randomly lie inside an other
|
|
|
|
//fly which lies completely inside the current Fly we could trigger an endless
|
|
|
|
//loop with the mentioned situation above.
|
|
|
|
//Using the helper class SwCrsrOszControl we prevent the recursion. During
|
2013-08-09 20:59:47 +02:00
|
|
|
//a recursion GetCrsrOfst picks the one which lies on top.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
|
2012-11-23 17:51:16 +01:00
|
|
|
SwCrsrMoveState* pCMS, bool ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
aOszCtrl.Entry( this );
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//If the Points lies inside the Fly, we try hard to set the Crsr inside it.
|
|
|
|
//However if the Point sits inside a Fly which is completely located inside
|
|
|
|
//the current one, we call GetCrsrOfst for it.
|
2000-09-18 23:08:29 +00:00
|
|
|
Calc();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bInside = Frm().IsInside( rPoint ) && Lower(),
|
|
|
|
bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//If an Frm contains a graphic, but only text was requested, it basically
|
|
|
|
//won't accept the Crsr.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bInside && pCMS && pCMS->eState == MV_SETONLYTEXT &&
|
|
|
|
(!Lower() || Lower()->IsNoTxtFrm()) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bInside = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwPageFrm *pPage = FindPageFrm();
|
|
|
|
if ( bInside && pPage && pPage->GetSortedObjs() )
|
|
|
|
{
|
|
|
|
SwOrderIter aIter( pPage );
|
|
|
|
aIter.Top();
|
|
|
|
while ( aIter() && !bRet )
|
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwVirtFlyDrawObj* pObj = static_cast<const SwVirtFlyDrawObj*>(aIter());
|
|
|
|
const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pFly && pFly->Frm().IsInside( rPoint ) &&
|
|
|
|
Frm().IsInside( pFly->Frm() ) )
|
|
|
|
{
|
|
|
|
if ( aOszCtrl.ChkOsz( pFly ) ||
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_True == (bRet = pFly->GetCrsrOfst( pPos, rPoint, pCMS )))
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
if ( pCMS && pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
aIter.Next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
while ( bInside && !bRet )
|
|
|
|
{
|
|
|
|
const SwFrm *pFrm = Lower();
|
|
|
|
while ( pFrm && !bRet )
|
|
|
|
{
|
|
|
|
pFrm->Calc();
|
|
|
|
if ( pFrm->Frm().IsInside( rPoint ) )
|
|
|
|
{
|
|
|
|
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
|
|
|
|
if ( pCMS && pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
}
|
|
|
|
if ( !bRet )
|
|
|
|
{
|
|
|
|
Point *pPoint = pCMS && pCMS->pFill ? new Point( rPoint ) : NULL;
|
|
|
|
const SwCntntFrm *pCnt = GetCntntPos(
|
2011-01-17 15:06:54 +01:00
|
|
|
rPoint, sal_True, sal_False, sal_False, pCMS );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pCMS && pCMS->bStop )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pPoint && pCnt->IsTxtFrm() )
|
|
|
|
{
|
|
|
|
pCnt->GetCrsrOfst( pPos, *pPoint, pCMS );
|
|
|
|
rPoint = *pPoint;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCnt->GetCrsrOfst( pPos, rPoint, pCMS );
|
|
|
|
delete pPoint;
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
aOszCtrl.Exit( this );
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Layout dependent cursor travelling */
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( pPam->GetNode() != (SwCntntNode*)GetNode() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
((SwCntntNode*)GetNode())->
|
|
|
|
MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent);
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCntntFrm::RightMargin(SwPaM *pPam, sal_Bool) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( pPam->GetNode() != (SwCntntNode*)GetNode() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
((SwCntntNode*)GetNode())->
|
|
|
|
MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent);
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static const SwCntntFrm *lcl_GetNxtCnt( const SwCntntFrm* pCnt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return pCnt->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static const SwCntntFrm *lcl_GetPrvCnt( const SwCntntFrm* pCnt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return pCnt->GetPrevCntntFrm();
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef const SwCntntFrm *(*GetNxtPrvCnt)( const SwCntntFrm* );
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/// Frame in repeated headline?
|
2012-11-30 08:49:55 +09:00
|
|
|
static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm,
|
2001-10-11 14:32:13 +00:00
|
|
|
const SwTabFrm** ppTFrm = 0 )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-10-11 14:32:13 +00:00
|
|
|
const SwTabFrm *pTab = pFrm->FindTabFrm();
|
|
|
|
if( ppTFrm )
|
|
|
|
*ppTFrm = pTab;
|
2004-05-03 12:47:58 +00:00
|
|
|
return pTab && pTab->IsFollow() && pTab->IsInHeadline( *pFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/// Skip protected table cells. Optionally also skip repeated headlines.
|
2013-08-04 17:23:08 +02:00
|
|
|
//MA 1998-01-26: Chg also skip other protected areas
|
|
|
|
//FME: Skip follow flow cells
|
2012-10-12 16:49:40 +02:00
|
|
|
static const SwCntntFrm * lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
|
2007-09-27 08:07:02 +00:00
|
|
|
GetNxtPrvCnt fnNxtPrv,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bMissHeadline,
|
|
|
|
sal_Bool bInReadOnly,
|
|
|
|
sal_Bool bMissFollowFlowLine )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( pCnt && pCnt->IsInTab() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bProtect = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pCnt && bProtect )
|
|
|
|
{
|
|
|
|
const SwLayoutFrm *pCell = pCnt->GetUpper();
|
|
|
|
while ( pCell && !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
|
|
|
if ( !pCell ||
|
2010-11-06 10:30:17 -05:00
|
|
|
(( ( bInReadOnly || !pCell->GetFmt()->GetProtect().IsCntntProtected() ) &&
|
2004-01-13 10:19:26 +00:00
|
|
|
( !bMissHeadline || !lcl_IsInRepeatedHeadline( pCell ) ) &&
|
2010-11-04 13:05:15 +01:00
|
|
|
( !bMissFollowFlowLine || !pCell->IsInFollowFlowRow() ) &&
|
2011-03-14 16:51:14 +00:00
|
|
|
!pCell->IsCoveredCell()) ) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bProtect = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( !bInReadOnly )
|
|
|
|
while ( pCnt && pCnt->IsProtected() )
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
|
|
|
|
|
|
|
return pCnt;
|
|
|
|
}
|
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static sal_Bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
|
2011-01-17 15:06:54 +01:00
|
|
|
GetNxtPrvCnt fnNxtPrv, sal_Bool bInReadOnly )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pPam->GetNode() == (SwCntntNode*)pStart->GetNode(),
|
2013-08-04 17:23:08 +02:00
|
|
|
"lcl_UpDown doesn't work for others." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwCntntFrm *pCnt = 0;
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
|
|
|
|
//We have to cheat a little bit during a table selection: Go to the
|
|
|
|
//beginning of the cell while going up and go to the end of the cell while
|
|
|
|
//going down.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bTblSel = false;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pStart->IsInTab() &&
|
2011-01-17 15:06:54 +01:00
|
|
|
pPam->GetNode( sal_True )->StartOfSectionNode() !=
|
|
|
|
pPam->GetNode( sal_False )->StartOfSectionNode() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:19:26 +00:00
|
|
|
bTblSel = true;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pCell = pStart->GetUpper();
|
|
|
|
while ( !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
2004-01-13 10:19:26 +00:00
|
|
|
|
|
|
|
// Check, if cell has a Prev/Follow cell:
|
|
|
|
const bool bFwd = ( fnNxtPrv == lcl_GetNxtCnt );
|
|
|
|
const SwLayoutFrm* pTmpCell = bFwd ?
|
|
|
|
((SwCellFrm*)pCell)->GetFollowCell() :
|
|
|
|
((SwCellFrm*)pCell)->GetPreviousCell();
|
|
|
|
|
|
|
|
const SwCntntFrm* pTmpStart = pStart;
|
2007-09-27 08:07:02 +00:00
|
|
|
while ( pTmpCell && 0 != ( pTmpStart = pTmpCell->ContainsCntnt() ) )
|
2004-01-13 10:19:26 +00:00
|
|
|
{
|
|
|
|
pCell = pTmpCell;
|
|
|
|
pTmpCell = bFwd ?
|
|
|
|
((SwCellFrm*)pCell)->GetFollowCell() :
|
|
|
|
((SwCellFrm*)pCell)->GetPreviousCell();
|
|
|
|
}
|
|
|
|
const SwCntntFrm *pNxt = pCnt = pTmpStart;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pCell->IsAnLower( pNxt ) )
|
2004-01-13 10:19:26 +00:00
|
|
|
{
|
|
|
|
pCnt = pNxt;
|
2000-09-18 23:08:29 +00:00
|
|
|
pNxt = (*fnNxtPrv)( pNxt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt ? pCnt : pStart );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
const SwTabFrm *pStTab = pStart->FindTabFrm();
|
2007-09-27 08:07:02 +00:00
|
|
|
const SwTabFrm *pTable = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bTab = pStTab || (pCnt && pCnt->IsInTab()) ? sal_True : sal_False;
|
|
|
|
sal_Bool bEnd = bTab ? sal_False : sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-04-21 08:56:56 +00:00
|
|
|
const SwFrm* pVertRefFrm = pStart;
|
|
|
|
if ( bTblSel && pStTab )
|
|
|
|
pVertRefFrm = pStTab;
|
|
|
|
SWRECTFN( pVertRefFrm )
|
2002-09-26 12:17:23 +00:00
|
|
|
|
2007-09-27 08:07:02 +00:00
|
|
|
SwTwips nX = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bTab )
|
|
|
|
{
|
2004-06-01 06:44:35 +00:00
|
|
|
// pStart or pCnt is inside a table. nX will be used for travelling:
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aRect( pStart->Frm() );
|
|
|
|
pStart->GetCharRect( aRect, *pPam->GetPoint() );
|
2002-09-26 12:17:23 +00:00
|
|
|
Point aCenter = aRect.Center();
|
|
|
|
nX = bVert ? aCenter.Y() : aCenter.X();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-01 06:44:35 +00:00
|
|
|
pTable = pCnt ? pCnt->FindTabFrm() : 0;
|
|
|
|
if ( !pTable )
|
|
|
|
pTable = pStTab;
|
2002-09-26 12:17:23 +00:00
|
|
|
|
2004-06-01 06:44:35 +00:00
|
|
|
if ( pStTab &&
|
|
|
|
!pStTab->GetUpper()->IsInTab() &&
|
|
|
|
!pTable->GetUpper()->IsInTab() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwFrm *pCell = pStart->GetUpper();
|
|
|
|
while ( pCell && !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
2013-09-26 11:01:05 +02:00
|
|
|
OSL_ENSURE( pCell, "could not find the cell" );
|
2002-09-26 12:17:23 +00:00
|
|
|
nX = (pCell->Frm().*fnRect->fnGetLeft)() +
|
|
|
|
(pCell->Frm().*fnRect->fnGetWidth)() / 2;
|
2004-06-01 06:44:35 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//The flow leads from one table to the next. The X-value needs to be
|
|
|
|
//corrected based on the middle of the starting cell by the amount
|
|
|
|
//of the offset of the tables.
|
2004-06-01 06:44:35 +00:00
|
|
|
if ( pStTab != pTable )
|
|
|
|
{
|
|
|
|
nX += (pTable->Frm().*fnRect->fnGetLeft)() -
|
|
|
|
(pStTab->Frm().*fnRect->fnGetLeft)();
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 10:19:26 +00:00
|
|
|
// Restrict nX to the left and right borders of pTab:
|
|
|
|
// (is this really necessary?)
|
2004-06-01 06:44:35 +00:00
|
|
|
if ( !pTable->GetUpper()->IsInTab() )
|
2002-09-26 12:17:23 +00:00
|
|
|
{
|
2004-06-01 06:44:35 +00:00
|
|
|
const sal_Bool bRTL = pTable->IsRightToLeft();
|
|
|
|
const long nPrtLeft = bRTL ?
|
|
|
|
(pTable->*fnRect->fnGetPrtRight)() :
|
|
|
|
(pTable->*fnRect->fnGetPrtLeft)();
|
2010-11-06 10:30:17 -05:00
|
|
|
if ( bRTL != (nX < nPrtLeft) )
|
2004-06-01 06:44:35 +00:00
|
|
|
nX = nPrtLeft;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const long nPrtRight = bRTL ?
|
|
|
|
(pTable->*fnRect->fnGetPrtLeft)() :
|
|
|
|
(pTable->*fnRect->fnGetPrtRight)();
|
2010-11-06 10:30:17 -05:00
|
|
|
if ( bRTL != (nX > nPrtRight) )
|
2004-06-01 06:44:35 +00:00
|
|
|
nX = nPrtRight;
|
|
|
|
}
|
2002-09-26 12:17:23 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-06-01 06:44:35 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//If I'm in the DocumentBody, I wan't to stay there.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pStart->IsInDocBody() )
|
2004-06-01 06:44:35 +00:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pCnt && (!pCnt->IsInDocBody() ||
|
|
|
|
(pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow())))
|
|
|
|
{
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-06-01 06:44:35 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//If I'm in the FootNoteArea, I try to reach the next FootNoteArea in
|
|
|
|
//case of necessity.
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( pStart->IsInFtn() )
|
2004-06-01 06:44:35 +00:00
|
|
|
{
|
2009-02-13 11:19:56 +00:00
|
|
|
while ( pCnt && (!pCnt->IsInFtn() ||
|
|
|
|
(pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow())))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-06-01 06:44:35 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//In Flys we can go ahead blindly as long as we find a Cntnt.
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( pStart->IsInFly() )
|
|
|
|
{
|
|
|
|
if ( pCnt && pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow() )
|
|
|
|
{
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Otherwise I'll just refuse to leave to current area.
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( pCnt )
|
|
|
|
{
|
|
|
|
const SwFrm *pUp = pStart->GetUpper(); //Head/Foot
|
|
|
|
while ( pUp && pUp->GetUpper() && !(pUp->GetType() & 0x0018 ) )
|
|
|
|
pUp = pUp->GetUpper();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bSame = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrm *pCntUp = pCnt->GetUpper();
|
|
|
|
while ( pCntUp && !bSame )
|
|
|
|
{ if ( pUp == pCntUp )
|
2011-01-17 15:06:54 +01:00
|
|
|
bSame = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
pCntUp = pCntUp->GetUpper();
|
|
|
|
}
|
|
|
|
if ( !bSame )
|
|
|
|
pCnt = 0;
|
2009-02-13 11:19:56 +00:00
|
|
|
else if ( pCnt && pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow() ) // i73332
|
|
|
|
{
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2009-02-13 11:19:56 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( bTab )
|
|
|
|
{
|
|
|
|
if ( !pCnt )
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{ const SwTabFrm *pTab = pCnt->FindTabFrm();
|
|
|
|
if( !pTab )
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( pTab != pTable )
|
2004-06-01 06:44:35 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//The flow leads from one table to the next. The X-value
|
|
|
|
//needs to be corrected by the amount of the offset of
|
|
|
|
//the tables
|
2004-06-01 06:44:35 +00:00
|
|
|
if ( pTable &&
|
|
|
|
!pTab->GetUpper()->IsInTab() &&
|
|
|
|
!pTable->GetUpper()->IsInTab() )
|
2000-09-18 23:08:29 +00:00
|
|
|
nX += pTab->Frm().Left() - pTable->Frm().Left();
|
|
|
|
pTable = pTab;
|
|
|
|
}
|
2004-06-01 06:44:35 +00:00
|
|
|
const SwLayoutFrm *pCell = pTable ? pCnt->GetUpper() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pCell && !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
2002-09-26 12:17:23 +00:00
|
|
|
|
|
|
|
Point aInsideCell;
|
|
|
|
Point aInsideCnt;
|
2002-09-26 12:47:44 +00:00
|
|
|
if ( pCell )
|
2002-09-26 12:17:23 +00:00
|
|
|
{
|
2002-09-26 12:47:44 +00:00
|
|
|
long nTmpTop = (pCell->Frm().*fnRect->fnGetTop)();
|
|
|
|
if ( bVert )
|
|
|
|
{
|
2002-09-27 05:59:38 +00:00
|
|
|
if ( nTmpTop )
|
|
|
|
--nTmpTop;
|
2002-09-26 12:17:23 +00:00
|
|
|
|
2002-09-27 05:59:38 +00:00
|
|
|
aInsideCell = Point( nTmpTop, nX );
|
2002-09-26 12:47:44 +00:00
|
|
|
}
|
|
|
|
else
|
2002-09-27 05:59:38 +00:00
|
|
|
aInsideCell = Point( nX, nTmpTop );
|
2002-09-26 12:47:44 +00:00
|
|
|
}
|
2002-09-26 12:17:23 +00:00
|
|
|
|
2002-09-26 12:47:44 +00:00
|
|
|
long nTmpTop = (pCnt->Frm().*fnRect->fnGetTop)();
|
|
|
|
if ( bVert )
|
|
|
|
{
|
2002-09-27 05:59:38 +00:00
|
|
|
if ( nTmpTop )
|
|
|
|
--nTmpTop;
|
2002-09-26 12:17:23 +00:00
|
|
|
|
2002-09-27 05:59:38 +00:00
|
|
|
aInsideCnt = Point( nTmpTop, nX );
|
2002-09-26 12:17:23 +00:00
|
|
|
}
|
|
|
|
else
|
2002-09-27 05:59:38 +00:00
|
|
|
aInsideCnt = Point( nX, nTmpTop );
|
2002-09-26 12:17:23 +00:00
|
|
|
|
|
|
|
if ( pCell && pCell->Frm().IsInside( aInsideCell ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2013-08-04 17:23:08 +02:00
|
|
|
//Get the right Cntnt out of the cell.
|
2004-06-01 06:44:35 +00:00
|
|
|
if ( !pCnt->Frm().IsInside( aInsideCnt ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
pCnt = pCell->ContainsCntnt();
|
|
|
|
if ( fnNxtPrv == lcl_GetPrvCnt )
|
|
|
|
while ( pCell->IsAnLower(pCnt->GetNextCntntFrm()) )
|
|
|
|
pCnt = pCnt->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
}
|
2002-09-26 12:17:23 +00:00
|
|
|
else if ( pCnt->Frm().IsInside( aInsideCnt ) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !bEnd )
|
|
|
|
{
|
|
|
|
pCnt = (*fnNxtPrv)( pCnt );
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, sal_True, bInReadOnly, bTblSel );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} while ( !bEnd ||
|
|
|
|
(pCnt && pCnt->IsTxtFrm() && ((SwTxtFrm*)pCnt)->IsHiddenNow()));
|
|
|
|
|
|
|
|
if( pCnt )
|
2013-08-04 17:23:08 +02:00
|
|
|
{ // set the Point on the Content-Node
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode();
|
|
|
|
pPam->GetPoint()->nNode = *pCNd;
|
|
|
|
if ( fnNxtPrv == lcl_GetPrvCnt )
|
|
|
|
pCNd->MakeEndIndex( (SwIndex*)&pPam->GetPoint()->nContent );
|
|
|
|
else
|
|
|
|
pCNd->MakeStartIndex( (SwIndex*)&pPam->GetPoint()->nContent );
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCntntFrm::UnitUp( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return ::lcl_UpDown( pPam, this, lcl_GetPrvCnt, bInReadOnly );
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCntntFrm::UnitDown( SwPaM* pPam, const SwTwips, sal_Bool bInReadOnly ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
return ::lcl_UpDown( pPam, this, lcl_GetNxtCnt, bInReadOnly );
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Returns the number of the current page.
|
|
|
|
*
|
|
|
|
* If the method gets a PaM then the current page is the one in which the PaM sits. Otherwise the
|
|
|
|
* current page is the first one inside the VisibleArea. We only work on available pages!
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-09-26 11:01:05 +02:00
|
|
|
OSL_ENSURE( pActualCrsr, "got no page cursor" );
|
2010-12-15 09:13:59 +01:00
|
|
|
SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode().
|
2011-02-09 19:07:37 +01:00
|
|
|
GetCntntNode()->getLayoutFrm( this, 0,
|
2000-09-18 23:08:29 +00:00
|
|
|
pActualCrsr->GetPoint(),
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
return pActFrm->FindPageFrm()->GetPhyPageNum();
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Returns a PaM which sits at the beginning of the requested page.
|
|
|
|
*
|
|
|
|
* Formatting is done as far as necessary.
|
|
|
|
* The PaM sits on the last page, if the page number was chosen to big.
|
|
|
|
*
|
|
|
|
* @return Null, if the operation was not possible.
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwPageFrm *pPage = (SwPageFrm*)Lower();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bEnd =sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( !bEnd && pPage->GetPhyPageNum() != nPageNum )
|
|
|
|
{ if ( pPage->GetNext() )
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
else
|
2013-08-04 17:23:08 +02:00
|
|
|
{ //Search the first CntntFrm and format until a new page is started
|
|
|
|
//or until the CntntFrm are all done.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pCntnt = pPage->ContainsCntnt();
|
|
|
|
while ( pCntnt && pPage->IsAnLower( pCntnt ) )
|
2004-01-13 10:19:26 +00:00
|
|
|
{
|
|
|
|
pCntnt->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
//Either this is a new page or we found the last page.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pPage->GetNext() )
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
//pPage now points to the 'requested' page. Now we have to create the PaM
|
|
|
|
//on the beginning of the first CntntFrm in the body-text.
|
|
|
|
//If this is a footnote-page, the PaM will be set in the first footnote.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pCntnt = pPage->ContainsCntnt();
|
|
|
|
if ( pPage->IsFtnPage() )
|
|
|
|
while ( pCntnt && !pCntnt->IsInFtn() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
else
|
|
|
|
while ( pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
if ( pCntnt )
|
|
|
|
{
|
|
|
|
SwCntntNode* pCNd = (SwCntntNode*)pCntnt->GetNode();
|
|
|
|
pToSet->GetPoint()->nNode = *pCNd;
|
|
|
|
pCNd->MakeStartIndex( (SwIndex*)&pToSet->GetPoint()->nContent );
|
|
|
|
pToSet->GetPoint()->nContent = ((SwTxtFrm*)pCntnt)->GetOfst();
|
|
|
|
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
|
|
|
SwShellCrsr* pSCrsr = dynamic_cast<SwShellCrsr*>(pToSet);
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pSCrsr )
|
|
|
|
{
|
|
|
|
Point &rPt = pSCrsr->GetPtPos();
|
|
|
|
rPt = pCntnt->Frm().Pos();
|
|
|
|
rPt += pCntnt->Prt().Pos();
|
|
|
|
}
|
|
|
|
return pPage->GetPhyPageNum();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwCntntFrm *GetFirstSub( const SwLayoutFrm *pLayout )
|
|
|
|
{
|
|
|
|
return ((SwPageFrm*)pLayout)->FindFirstBodyCntnt();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwCntntFrm *GetLastSub( const SwLayoutFrm *pLayout )
|
|
|
|
{
|
|
|
|
return ((SwPageFrm*)pLayout)->FindLastBodyCntnt();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLayoutFrm *GetNextFrm( const SwLayoutFrm *pFrm )
|
|
|
|
{
|
2005-01-28 14:27:06 +00:00
|
|
|
SwLayoutFrm *pNext =
|
|
|
|
(pFrm->GetNext() && pFrm->GetNext()->IsLayoutFrm()) ?
|
2000-09-18 23:08:29 +00:00
|
|
|
(SwLayoutFrm*)pFrm->GetNext() : 0;
|
2005-01-28 14:27:06 +00:00
|
|
|
// #i39402# in case of an empty page
|
|
|
|
if(pNext && !pNext->ContainsCntnt())
|
|
|
|
pNext = (pNext->GetNext() && pNext->GetNext()->IsLayoutFrm()) ?
|
|
|
|
(SwLayoutFrm*)pNext->GetNext() : 0;
|
|
|
|
return pNext;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SwLayoutFrm *GetThisFrm( const SwLayoutFrm *pFrm )
|
|
|
|
{
|
|
|
|
return (SwLayoutFrm*)pFrm;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwLayoutFrm *GetPrevFrm( const SwLayoutFrm *pFrm )
|
|
|
|
{
|
2005-01-28 14:27:06 +00:00
|
|
|
SwLayoutFrm *pPrev =
|
|
|
|
(pFrm->GetPrev() && pFrm->GetPrev()->IsLayoutFrm()) ?
|
2000-09-18 23:08:29 +00:00
|
|
|
(SwLayoutFrm*)pFrm->GetPrev() : 0;
|
2005-01-28 14:27:06 +00:00
|
|
|
// #i39402# in case of an empty page
|
|
|
|
if(pPrev && !pPrev->ContainsCntnt())
|
|
|
|
pPrev = (pPrev->GetPrev() && pPrev->GetPrev()->IsLayoutFrm()) ?
|
|
|
|
(SwLayoutFrm*)pPrev->GetPrev() : 0;
|
|
|
|
return pPrev;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Now we can also initialize de function pointers;
|
|
|
|
//they are declared in cshtyp.hxx
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPosPage fnPageStart = GetFirstSub;
|
|
|
|
SwPosPage fnPageEnd = GetLastSub;
|
|
|
|
SwWhichPage fnPagePrev = GetPrevFrm;
|
|
|
|
SwWhichPage fnPageCurr = GetThisFrm;
|
|
|
|
SwWhichPage fnPageNext = GetNextFrm;
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/**
|
|
|
|
* Returns the first/last Contentframe (controlled using the parameter fnPosPage)
|
|
|
|
* of the current/previous/next page (controlled using the parameter fnWhichPage).
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPosPage fnPosPage, SwPaM *pPam )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//First find the requested page, at first the current, then the one which
|
|
|
|
//was requests through fnWichPage.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pLayoutFrm = pCnt->FindPageFrm();
|
|
|
|
if ( !pLayoutFrm || (0 == (pLayoutFrm = (*fnWhichPage)(pLayoutFrm))) )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Now the desired CntntFrm below the page
|
2000-09-18 23:08:29 +00:00
|
|
|
if( 0 == (pCnt = (*fnPosPage)(pLayoutFrm)) )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
// repeated headlines in tables
|
|
|
|
if ( pCnt->IsInTab() && fnPosPage == GetFirstSub )
|
|
|
|
{
|
|
|
|
const SwTabFrm* pTab = pCnt->FindTabFrm();
|
2004-05-03 12:47:58 +00:00
|
|
|
if ( pTab->IsFollow() )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2004-05-03 12:47:58 +00:00
|
|
|
if ( pTab->IsInHeadline( *pCnt ) )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2004-05-03 12:47:58 +00:00
|
|
|
SwLayoutFrm* pRow = pTab->GetFirstNonHeadlineRow();
|
|
|
|
if ( pRow )
|
|
|
|
{
|
|
|
|
// We are in the first line of a follow table
|
|
|
|
// with repeated headings.
|
|
|
|
// To actually make a "real" move we take the first content
|
|
|
|
// of the next row
|
|
|
|
pCnt = pRow->ContainsCntnt();
|
|
|
|
if ( ! pCnt )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2004-05-03 12:47:58 +00:00
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode();
|
|
|
|
pPam->GetPoint()->nNode = *pCNd;
|
|
|
|
xub_StrLen nIdx;
|
|
|
|
if( fnPosPage == GetFirstSub )
|
|
|
|
nIdx = ((SwTxtFrm*)pCnt)->GetOfst();
|
|
|
|
else
|
|
|
|
nIdx = pCnt->GetFollow() ?
|
|
|
|
((SwTxtFrm*)pCnt)->GetFollow()->GetOfst()-1 : pCNd->Len();
|
|
|
|
pPam->GetPoint()->nContent.Assign( pCNd, nIdx );
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Calculate the distance between the two points.
|
|
|
|
//'delta' X^2 + 'delta'Y^2 = 'distance'^2
|
2013-04-11 00:21:40 -03:00
|
|
|
sal_uInt32 dX = std::max( rPt1.X(), rPt2.X() ) -
|
|
|
|
std::min( rPt1.X(), rPt2.X() ),
|
|
|
|
dY = std::max( rPt1.Y(), rPt2.Y() ) -
|
|
|
|
std::min( rPt1.Y(), rPt2.Y() );
|
2000-09-18 23:08:29 +00:00
|
|
|
BigInt dX1( dX ), dY1( dY );
|
|
|
|
dX1 *= dX1; dY1 *= dY1;
|
|
|
|
return ::SqRt( dX1 + dY1 );
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Check if the point lies inside the page part in wich also the CntntFrame lies.
|
|
|
|
*
|
|
|
|
* In this context header, page body, footer and footnote-container count as page part.
|
|
|
|
* This will suit the purpose that the CntntFrm which lies in the "right" page part will be
|
|
|
|
* accepted instead of one which doesn't lie there although his distance to the point is shorter.
|
|
|
|
*/
|
2012-10-12 16:49:40 +02:00
|
|
|
static const SwLayoutFrm* lcl_Inside( const SwCntntFrm *pCnt, Point& rPt )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwLayoutFrm* pUp = pCnt->GetUpper();
|
|
|
|
while( pUp )
|
|
|
|
{
|
|
|
|
if( pUp->IsPageBodyFrm() || pUp->IsFooterFrm() || pUp->IsHeaderFrm() )
|
|
|
|
{
|
|
|
|
if( rPt.Y() >= pUp->Frm().Top() && rPt.Y() <= pUp->Frm().Bottom() )
|
|
|
|
return pUp;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if( pUp->IsFtnContFrm() )
|
|
|
|
return pUp->Frm().IsInside( rPt ) ? pUp : NULL;
|
|
|
|
pUp = pUp->GetUpper();
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Search for the nearest Cntnt to pass.
|
|
|
|
*
|
|
|
|
* Considers the previous, the current and the next page.
|
|
|
|
* If no content is found, the area gets expanded until one is found.
|
|
|
|
*
|
|
|
|
* @return The 'semantically correct' position inside the PrtArea of the found CntntFrm.
|
|
|
|
*/
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *SwLayoutFrm::GetCntntPos( Point& rPoint,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bDontLeave,
|
|
|
|
const sal_Bool bBodyOnly,
|
|
|
|
const sal_Bool bCalc,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCrsrMoveState *pCMS,
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bDefaultExpand ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Determine the first CntntFrm.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pStart = (!bDontLeave && bDefaultExpand && GetPrev()) ?
|
|
|
|
(SwLayoutFrm*)GetPrev() : this;
|
|
|
|
const SwCntntFrm *pCntnt = pStart->ContainsCntnt();
|
|
|
|
|
|
|
|
if ( !pCntnt && (GetPrev() && !bDontLeave) )
|
|
|
|
pCntnt = ContainsCntnt();
|
|
|
|
|
|
|
|
if ( bBodyOnly && pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
while ( pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
|
|
|
|
const SwCntntFrm *pActual= pCntnt;
|
|
|
|
const SwLayoutFrm *pInside = NULL;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nMaxPage = GetPhyPageNum() + (bDefaultExpand ? 1 : 0);
|
2000-09-18 23:08:29 +00:00
|
|
|
Point aPoint = rPoint;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong nDistance = ULONG_MAX;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
while ( true ) //A loop to be sure we always find one.
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
while ( pCntnt &&
|
|
|
|
((!bDontLeave || IsAnLower( pCntnt )) &&
|
|
|
|
(pCntnt->GetPhyPageNum() <= nMaxPage)) )
|
|
|
|
{
|
|
|
|
if ( ( bCalc || pCntnt->Frm().Width() ) &&
|
|
|
|
( !bBodyOnly || pCntnt->IsInDocBody() ) )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//If the Cntnt lies in a protected area (cell, Ftn, section),
|
|
|
|
//we search the next Cntnt which is not protected.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pComp = pCntnt;
|
2011-01-17 15:06:54 +01:00
|
|
|
pCntnt = ::lcl_MissProtectedFrames( pCntnt, lcl_GetNxtCnt, sal_False,
|
|
|
|
pCMS ? pCMS->bSetInReadOnly : sal_False, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pComp != pCntnt )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ( !pCntnt->IsTxtFrm() || !((SwTxtFrm*)pCntnt)->IsHiddenNow() )
|
|
|
|
{
|
|
|
|
if ( bCalc )
|
|
|
|
pCntnt->Calc();
|
|
|
|
|
|
|
|
SwRect aCntFrm( pCntnt->UnionFrm() );
|
|
|
|
if ( aCntFrm.IsInside( rPoint ) )
|
|
|
|
{
|
|
|
|
pActual = pCntnt;
|
|
|
|
aPoint = rPoint;
|
|
|
|
break;
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
//The distance from rPoint to the nearest Point of pCntnt
|
|
|
|
//will now be calculated.
|
2000-09-18 23:08:29 +00:00
|
|
|
Point aCntntPoint( rPoint );
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//First set the vertical position
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aCntFrm.Top() > aCntntPoint.Y() )
|
|
|
|
aCntntPoint.Y() = aCntFrm.Top();
|
|
|
|
else if ( aCntFrm.Bottom() < aCntntPoint.Y() )
|
|
|
|
aCntntPoint.Y() = aCntFrm.Bottom();
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Now the horizontal position
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aCntFrm.Left() > aCntntPoint.X() )
|
|
|
|
aCntntPoint.X() = aCntFrm.Left();
|
|
|
|
else if ( aCntFrm.Right() < aCntntPoint.X() )
|
|
|
|
aCntntPoint.X() = aCntFrm.Right();
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
// pInside is a page area in which the point lies. As soon
|
|
|
|
// as pInside != 0 only frames are accepted which are
|
|
|
|
// placed inside.
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pInside || ( pInside->IsAnLower( pCntnt ) &&
|
|
|
|
( !pCntnt->IsInFtn() || pInside->IsFtnContFrm() ) ) )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nDiff = ::CalcDiff( aCntntPoint, rPoint );
|
2013-08-04 17:23:08 +02:00
|
|
|
sal_Bool bBetter = nDiff < nDistance; // This one is nearer
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pInside )
|
|
|
|
{
|
|
|
|
pInside = lcl_Inside( pCntnt, rPoint );
|
2013-08-04 17:23:08 +02:00
|
|
|
if( pInside ) // In the "right" page area
|
2011-01-17 15:06:54 +01:00
|
|
|
bBetter = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( bBetter )
|
|
|
|
{
|
|
|
|
aPoint = aCntntPoint;
|
|
|
|
nDistance = nDiff;
|
|
|
|
pActual = pCntnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
if ( bBodyOnly )
|
|
|
|
while ( pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
if ( !pActual )
|
2013-08-04 17:23:08 +02:00
|
|
|
{ //If we not yet found one we have to expand the searched
|
|
|
|
//area, sometime we will find one!
|
|
|
|
//MA 1997-01-09: Opt for many empty pages - if we only search inside
|
|
|
|
//the body, we can expand the searched area sufficiently in one step.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bBodyOnly )
|
|
|
|
{
|
|
|
|
while ( !pCntnt && pStart->GetPrev() )
|
|
|
|
{
|
|
|
|
++nMaxPage;
|
|
|
|
if( !pStart->GetPrev()->IsLayoutFrm() )
|
|
|
|
return 0;
|
|
|
|
pStart = (SwLayoutFrm*)pStart->GetPrev();
|
|
|
|
pCntnt = pStart->IsInDocBody()
|
|
|
|
? pStart->ContainsCntnt()
|
|
|
|
: pStart->FindPageFrm()->FindFirstBodyCntnt();
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
if ( !pCntnt ) // Somewhere down the road we have to start with one!
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
pCntnt = pStart->FindPageFrm()->GetUpper()->ContainsCntnt();
|
|
|
|
while ( pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
if ( !pCntnt )
|
2013-08-04 17:23:08 +02:00
|
|
|
return 0; // There is no document content yet!
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
++nMaxPage;
|
|
|
|
if ( pStart->GetPrev() )
|
|
|
|
{
|
|
|
|
if( !pStart->GetPrev()->IsLayoutFrm() )
|
|
|
|
return 0;
|
|
|
|
pStart = (SwLayoutFrm*)pStart->GetPrev();
|
|
|
|
pCntnt = pStart->ContainsCntnt();
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
else // Somewhere down the road we have to start with one!
|
2000-09-18 23:08:29 +00:00
|
|
|
pCntnt = pStart->FindPageFrm()->GetUpper()->ContainsCntnt();
|
|
|
|
}
|
|
|
|
pActual = pCntnt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-11-24 00:52:07 +01:00
|
|
|
OSL_ENSURE( pActual, "no Cntnt found." );
|
|
|
|
OSL_ENSURE( !bBodyOnly || pActual->IsInDocBody(), "Cntnt not in Body." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Special case for selecting tables not in repeated TblHeadlines.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pActual->IsInTab() && pCMS && pCMS->eState == MV_TBLSEL )
|
|
|
|
{
|
|
|
|
const SwTabFrm *pTab = pActual->FindTabFrm();
|
2004-05-03 12:47:58 +00:00
|
|
|
if ( pTab->IsFollow() && pTab->IsInHeadline( *pActual ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwCrsrMoveState*)pCMS)->bStop = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//A small correction at the first/last
|
2000-09-18 23:08:29 +00:00
|
|
|
Size aActualSize( pActual->Prt().SSize() );
|
|
|
|
if ( aActualSize.Height() > pActual->GetUpper()->Prt().Height() )
|
|
|
|
aActualSize.Height() = pActual->GetUpper()->Prt().Height();
|
2002-11-15 14:58:53 +00:00
|
|
|
|
|
|
|
SWRECTFN( pActual )
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !pActual->GetPrev() &&
|
2002-11-15 14:58:53 +00:00
|
|
|
(*fnRect->fnYDiff)( (pActual->*fnRect->fnGetPrtTop)(),
|
|
|
|
bVert ? rPoint.X() : rPoint.Y() ) > 0 )
|
|
|
|
{
|
|
|
|
aPoint.Y() = pActual->Frm().Top() + pActual->Prt().Top();
|
|
|
|
aPoint.X() = pActual->Frm().Left() +
|
|
|
|
( pActual->IsRightToLeft() || bVert ?
|
|
|
|
pActual->Prt().Right() :
|
|
|
|
pActual->Prt().Left() );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( !pActual->GetNext() &&
|
2002-11-15 14:58:53 +00:00
|
|
|
(*fnRect->fnYDiff)( (pActual->*fnRect->fnGetPrtBottom)(),
|
|
|
|
bVert ? rPoint.X() : rPoint.Y() ) < 0 )
|
|
|
|
{
|
|
|
|
aPoint.Y() = pActual->Frm().Top() + pActual->Prt().Bottom();
|
|
|
|
aPoint.X() = pActual->Frm().Left() +
|
|
|
|
( pActual->IsRightToLeft() || bVert ?
|
|
|
|
pActual->Prt().Left() :
|
|
|
|
pActual->Prt().Right() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2002-11-15 14:58:53 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Bring the Point in to the PrtArea
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bCalc )
|
|
|
|
pActual->Calc();
|
|
|
|
const SwRect aRect( pActual->Frm().Pos() + pActual->Prt().Pos(),
|
|
|
|
aActualSize );
|
|
|
|
if ( aPoint.Y() < aRect.Top() )
|
|
|
|
aPoint.Y() = aRect.Top();
|
|
|
|
else if ( aPoint.Y() > aRect.Bottom() )
|
|
|
|
aPoint.Y() = aRect.Bottom();
|
|
|
|
if ( aPoint.X() < aRect.Left() )
|
|
|
|
aPoint.X() = aRect.Left();
|
|
|
|
else if ( aPoint.X() > aRect.Right() )
|
|
|
|
aPoint.X() = aRect.Right();
|
|
|
|
rPoint = aPoint;
|
|
|
|
return pActual;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Same as SwLayoutFrm::GetCntntPos(). Specialized for fields and border. */
|
2000-09-18 23:08:29 +00:00
|
|
|
void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Determine the first CntntFrm.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pCntnt = ContainsCntnt();
|
|
|
|
if ( pCntnt )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Look back one more (if possible).
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pTmp = pCntnt->GetPrevCntntFrm();
|
|
|
|
while ( pTmp && !pTmp->IsInDocBody() )
|
|
|
|
pTmp = pTmp->GetPrevCntntFrm();
|
|
|
|
if ( pTmp )
|
|
|
|
pCntnt = pTmp;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCntnt = GetUpper()->ContainsCntnt();
|
|
|
|
|
|
|
|
const SwCntntFrm *pAct = pCntnt;
|
|
|
|
Point aAct = rPt;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong nDist = ULONG_MAX;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
while ( pCntnt )
|
|
|
|
{
|
|
|
|
SwRect aCntFrm( pCntnt->UnionFrm() );
|
|
|
|
if ( aCntFrm.IsInside( rPt ) )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//This is the nearest one.
|
2000-09-18 23:08:29 +00:00
|
|
|
pAct = pCntnt;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Calculate the distance from rPt to the nearest point of pCntnt.
|
2000-09-18 23:08:29 +00:00
|
|
|
Point aPoint( rPt );
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Calculate the vertical position first
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aCntFrm.Top() > rPt.Y() )
|
|
|
|
aPoint.Y() = aCntFrm.Top();
|
|
|
|
else if ( aCntFrm.Bottom() < rPt.Y() )
|
|
|
|
aPoint.Y() = aCntFrm.Bottom();
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//And now the horizontal position
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aCntFrm.Left() > rPt.X() )
|
|
|
|
aPoint.X() = aCntFrm.Left();
|
|
|
|
else if ( aCntFrm.Right() < rPt.X() )
|
|
|
|
aPoint.X() = aCntFrm.Right();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nDiff = ::CalcDiff( aPoint, rPt );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nDiff < nDist )
|
|
|
|
{
|
|
|
|
aAct = aPoint;
|
|
|
|
nDist = nDiff;
|
|
|
|
pAct = pCntnt;
|
|
|
|
}
|
|
|
|
else if ( aCntFrm.Top() > Frm().Bottom() )
|
2013-08-04 17:23:08 +02:00
|
|
|
//In terms of fields, it's not possible to be closer any more!
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
while ( pCntnt && !pCntnt->IsInDocBody() )
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Bring the point into the PrtArea.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwRect aRect( pAct->Frm().Pos() + pAct->Prt().Pos(), pAct->Prt().SSize() );
|
|
|
|
if ( aAct.Y() < aRect.Top() )
|
|
|
|
aAct.Y() = aRect.Top();
|
|
|
|
else if ( aAct.Y() > aRect.Bottom() )
|
|
|
|
aAct.Y() = aRect.Bottom();
|
|
|
|
if ( aAct.X() < aRect.Left() )
|
|
|
|
aAct.X() = aRect.Left();
|
|
|
|
else if ( aAct.X() > aRect.Right() )
|
|
|
|
aAct.X() = aRect.Right();
|
|
|
|
|
|
|
|
if( !pAct->IsValid() )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
// CntntFrm not formated -> always on node-beginning
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntNode* pCNd = (SwCntntNode*)pAct->GetNode();
|
2013-08-04 17:23:08 +02:00
|
|
|
OSL_ENSURE( pCNd, "Where is my CntntNode?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
rPos.nNode = *pCNd;
|
|
|
|
rPos.nContent.Assign( pCNd, 0 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwCrsrMoveState aTmpState( MV_SETONLYTEXT );
|
|
|
|
pAct->GetCrsrOfst( &rPos, aAct, &aTmpState );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-18 12:37:38 -03:00
|
|
|
// #123110# - helper class to disable creation of an action
|
2005-07-08 10:04:45 +00:00
|
|
|
// by a callback event - e.g., change event from a drawing object
|
|
|
|
class DisableCallbackAction
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SwRootFrm& mrRootFrm;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool mbOldCallbackActionState;
|
2005-07-08 10:04:45 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
DisableCallbackAction( const SwRootFrm& _rRootFrm ) :
|
|
|
|
mrRootFrm( const_cast<SwRootFrm&>(_rRootFrm) ),
|
|
|
|
mbOldCallbackActionState( _rRootFrm.IsCallbackActionEnabled() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
mrRootFrm.SetCallbackActionEnabled( sal_False );
|
2005-07-08 10:04:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
~DisableCallbackAction()
|
|
|
|
{
|
|
|
|
mrRootFrm.SetCallbackActionEnabled( mbOldCallbackActionState );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Search the nearest Cntnt to the passed point.
|
|
|
|
*
|
|
|
|
* Only search inside the BodyText.
|
|
|
|
* @note Only the nearest vertically one will be searched.
|
|
|
|
* @note JP 11.10.2001: only in tables we try to find the right column - Bug 72294
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-04-18 12:37:38 -03:00
|
|
|
// #123110# - disable creation of an action by a callback
|
2005-07-08 10:04:45 +00:00
|
|
|
// event during processing of this method. Needed because formatting is
|
|
|
|
// triggered by this method.
|
|
|
|
DisableCallbackAction aDisableCallbackAction( *this );
|
2013-08-04 17:23:08 +02:00
|
|
|
//Search the first CntntFrm and his successor in the body area.
|
|
|
|
//To be efficient (and not formatting too much) we'll start at the correct
|
|
|
|
//page.
|
2000-09-18 23:08:29 +00:00
|
|
|
SwLayoutFrm *pPage = (SwLayoutFrm*)Lower();
|
2001-10-17 09:35:11 +00:00
|
|
|
if( pPage )
|
|
|
|
while( pPage->GetNext() && pPage->Frm().Bottom() < rPoint.Y() )
|
|
|
|
pPage = (SwLayoutFrm*)pPage->GetNext();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwCntntFrm *pCnt = pPage ? pPage->ContainsCntnt() : ContainsCntnt();
|
|
|
|
while ( pCnt && !pCnt->IsInDocBody() )
|
|
|
|
pCnt = pCnt->GetNextCntntFrm();
|
|
|
|
|
|
|
|
if ( !pCnt )
|
|
|
|
return Point( 0, 0 );
|
|
|
|
|
|
|
|
pCnt->Calc();
|
2001-10-11 14:32:13 +00:00
|
|
|
if( !bNext )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
// As long as the point lies before the first CntntFrm and there are
|
|
|
|
// still precedent pages I'll go to the next page.
|
2001-10-11 14:32:13 +00:00
|
|
|
while ( rPoint.Y() < pCnt->Frm().Top() && pPage->GetPrev() )
|
|
|
|
{
|
|
|
|
pPage = (SwLayoutFrm*)pPage->GetPrev();
|
|
|
|
pCnt = pPage->ContainsCntnt();
|
|
|
|
while ( !pCnt )
|
|
|
|
{
|
|
|
|
pPage = (SwLayoutFrm*)pPage->GetPrev();
|
|
|
|
if ( pPage )
|
|
|
|
pCnt = pPage->ContainsCntnt();
|
|
|
|
else
|
|
|
|
return ContainsCntnt()->UnionFrm().Pos();
|
|
|
|
}
|
|
|
|
pCnt->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2001-10-11 14:32:13 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Does the point lie above the first CntntFrm?
|
2001-10-11 14:32:13 +00:00
|
|
|
if ( rPoint.Y() < pCnt->Frm().Top() && !lcl_IsInRepeatedHeadline( pCnt ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
return pCnt->UnionFrm().Pos();
|
|
|
|
|
|
|
|
while ( pCnt )
|
2001-10-11 14:32:13 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Does the point lie in the current CntntFrm?
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aCntFrm( pCnt->UnionFrm() );
|
2001-10-11 14:32:13 +00:00
|
|
|
if ( aCntFrm.IsInside( rPoint ) && !lcl_IsInRepeatedHeadline( pCnt ))
|
2000-09-18 23:08:29 +00:00
|
|
|
return rPoint;
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Is the current one the last CntntFrm?
|
|
|
|
//If the next CntntFrm lies behind the point, then the current on is the
|
|
|
|
//one we searched.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwCntntFrm *pNxt = pCnt->GetNextCntntFrm();
|
|
|
|
while ( pNxt && !pNxt->IsInDocBody() )
|
|
|
|
pNxt = pNxt->GetNextCntntFrm();
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Does the point lie behind the last CntntFrm?
|
2001-10-11 14:32:13 +00:00
|
|
|
if ( !pNxt )
|
|
|
|
return Point( aCntFrm.Right(), aCntFrm.Bottom() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//If the next CntntFrm lies behind the point then it is the one we
|
|
|
|
//searched.
|
2001-10-11 14:32:13 +00:00
|
|
|
const SwTabFrm* pTFrm;
|
|
|
|
pNxt->Calc();
|
|
|
|
if( pNxt->Frm().Top() > rPoint.Y() &&
|
|
|
|
!lcl_IsInRepeatedHeadline( pCnt, &pTFrm ) &&
|
|
|
|
( !pTFrm || pNxt->Frm().Left() > rPoint.X() ))
|
|
|
|
{
|
|
|
|
if( bNext )
|
|
|
|
return pNxt->Frm().Pos();
|
2000-09-18 23:08:29 +00:00
|
|
|
return Point( aCntFrm.Right(), aCntFrm.Bottom() );
|
2001-10-11 14:32:13 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt = pNxt;
|
|
|
|
}
|
|
|
|
return Point( 0, 0 );
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Returns the absolute document position of the desired page.
|
|
|
|
*
|
|
|
|
* Formatting is done only as far as needed and only if bFormat=sal_True.
|
|
|
|
* Pos is set to the one of the last page, if the page number was chosen to big.
|
|
|
|
*
|
|
|
|
* @return Null, if the operation failed.
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
Point SwRootFrm::GetPagePos( sal_uInt16 nPageNum ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwPageFrm *pPage = (const SwPageFrm*)Lower();
|
2013-03-03 00:44:38 +09:00
|
|
|
while ( true )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( pPage->GetPhyPageNum() >= nPageNum || !pPage->GetNext() )
|
|
|
|
break;
|
|
|
|
pPage = (const SwPageFrm*)pPage->GetNext();
|
|
|
|
}
|
|
|
|
return pPage->Frm().Pos();
|
|
|
|
}
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
/** get page frame by phyiscal page number
|
2013-08-09 20:59:47 +02:00
|
|
|
*
|
|
|
|
* @return pointer to the page frame with the given physical page number
|
|
|
|
*/
|
2003-03-27 14:45:43 +00:00
|
|
|
SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const
|
|
|
|
{
|
2003-12-01 16:19:20 +00:00
|
|
|
const SwPageFrm* pPageFrm = static_cast<const SwPageFrm*>( Lower() );
|
|
|
|
while ( pPageFrm && pPageFrm->GetPhyPageNum() < _nPageNum )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2003-12-01 16:19:20 +00:00
|
|
|
pPageFrm = static_cast<const SwPageFrm*>( pPageFrm->GetNext() );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( pPageFrm && pPageFrm->GetPhyPageNum() == _nPageNum )
|
|
|
|
{
|
|
|
|
return const_cast<SwPageFrm*>( pPageFrm );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/**
|
|
|
|
* @return sal_True, when the given physical pagenumber does't exist or this page is an empty page.
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwRootFrm::IsDummyPage( sal_uInt16 nPageNum ) const
|
2002-03-15 10:47:59 +00:00
|
|
|
{
|
|
|
|
if( !Lower() || !nPageNum || nPageNum > GetPageNum() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2002-03-15 10:47:59 +00:00
|
|
|
|
|
|
|
const SwPageFrm *pPage = (const SwPageFrm*)Lower();
|
|
|
|
while( pPage && nPageNum < pPage->GetPhyPageNum() )
|
|
|
|
pPage = (const SwPageFrm*)pPage->GetNext();
|
2011-01-17 15:06:54 +01:00
|
|
|
return pPage ? pPage->IsEmptyPage() : sal_True;
|
2002-03-15 10:47:59 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Is the Frm or rather the Section in which it lies protected?
|
|
|
|
*
|
|
|
|
* Also Fly in Fly in ... and Footnotes
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwFrm::IsProtected() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2008-09-04 09:19:40 +00:00
|
|
|
if (this->IsCntntFrm() && ((SwCntntFrm*)this)->GetNode())
|
|
|
|
{
|
|
|
|
const SwDoc *pDoc=((SwCntntFrm*)this)->GetNode()->GetDoc();
|
|
|
|
bool isFormProtected=pDoc->get(IDocumentSettingAccess::PROTECT_FORM );
|
|
|
|
if (isFormProtected)
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
return sal_False; // TODO a hack for now, well deal with it later, I we return true here we have a "double" locking
|
2008-09-04 09:19:40 +00:00
|
|
|
}
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
//The Frm can be protected in borders, cells or sections.
|
|
|
|
//Also goes up FlyFrms recursive and from footnote to anchor.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrm *pFrm = this;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if ( pFrm->IsCntntFrm() )
|
|
|
|
{
|
2002-10-02 11:54:53 +00:00
|
|
|
if ( ((SwCntntFrm*)pFrm)->GetNode() &&
|
|
|
|
((SwCntntFrm*)pFrm)->GetNode()->IsInProtectSect() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2002-10-02 11:54:53 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( ((SwLayoutFrm*)pFrm)->GetFmt() &&
|
|
|
|
((SwLayoutFrm*)pFrm)->GetFmt()->
|
|
|
|
GetProtect().IsCntntProtected() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2007-02-28 14:49:57 +00:00
|
|
|
if ( pFrm->IsCoveredCell() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2002-10-02 11:54:53 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pFrm->IsFlyFrm() )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//In a chain the protection of the content can be specified by the
|
|
|
|
//master of the chain.
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( ((SwFlyFrm*)pFrm)->GetPrevLink() )
|
|
|
|
{
|
|
|
|
SwFlyFrm *pMaster = (SwFlyFrm*)pFrm;
|
|
|
|
do
|
|
|
|
{ pMaster = pMaster->GetPrevLink();
|
|
|
|
} while ( pMaster->GetPrevLink() );
|
|
|
|
if ( pMaster->IsProtected() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-06-28 12:41:51 +00:00
|
|
|
pFrm = ((SwFlyFrm*)pFrm)->GetAnchorFrm();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if ( pFrm->IsFtnFrm() )
|
|
|
|
pFrm = ((SwFtnFrm*)pFrm)->GetRef();
|
|
|
|
else
|
|
|
|
pFrm = pFrm->GetUpper();
|
|
|
|
|
|
|
|
} while ( pFrm );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** @return the physical page number */
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 SwFrm::GetPhyPageNum() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwPageFrm *pPage = FindPageFrm();
|
|
|
|
return pPage ? pPage->GetPhyPageNum() : 0;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Decides if the page want to be a rightpage or not.
|
|
|
|
*
|
|
|
|
* If the first content of the page has a page descriptor, we take the follow
|
|
|
|
* of the page descriptor of the last not empty page. If this descriptor allows
|
|
|
|
* only right(left) pages and the page isn't an empty page then it wanna be
|
|
|
|
* such right(left) page. If the descriptor allows right and left pages, we
|
|
|
|
* look for a number offset in the first content. If there is one, odd number
|
|
|
|
* results right pages, even number results left pages.
|
2001-03-02 10:21:22 +00:00
|
|
|
* If there is no number offset, we take the physical page number instead,
|
|
|
|
* but a previous empty page don't count.
|
2013-08-09 20:59:47 +02:00
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwFrm::WannaRightPage() const
|
2001-03-02 10:21:22 +00:00
|
|
|
{
|
|
|
|
const SwPageFrm *pPage = FindPageFrm();
|
|
|
|
if ( !pPage || !pPage->GetUpper() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2001-03-02 10:21:22 +00:00
|
|
|
|
|
|
|
const SwFrm *pFlow = pPage->FindFirstBodyCntnt();
|
2012-06-21 13:40:06 +02:00
|
|
|
const SwPageDesc *pDesc = 0;
|
2013-08-29 17:16:44 +03:00
|
|
|
::boost::optional<sal_uInt16> oPgNum;
|
2001-03-02 10:21:22 +00:00
|
|
|
if ( pFlow )
|
|
|
|
{
|
|
|
|
if ( pFlow->IsInTab() )
|
|
|
|
pFlow = pFlow->FindTabFrm();
|
2001-03-15 09:16:52 +00:00
|
|
|
const SwFlowFrm *pTmp = SwFlowFrm::CastFlowFrm( pFlow );
|
|
|
|
if ( !pTmp->IsFollow() )
|
|
|
|
{
|
|
|
|
const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
|
2012-06-21 13:40:06 +02:00
|
|
|
pDesc = rPgDesc.GetPageDesc();
|
2013-08-29 17:16:44 +03:00
|
|
|
oPgNum = rPgDesc.GetNumOffset();
|
2001-03-15 09:16:52 +00:00
|
|
|
}
|
2001-03-02 10:21:22 +00:00
|
|
|
}
|
|
|
|
if ( !pDesc )
|
|
|
|
{
|
|
|
|
SwPageFrm *pPrv = (SwPageFrm*)pPage->GetPrev();
|
|
|
|
if( pPrv && pPrv->IsEmptyPage() )
|
|
|
|
pPrv = (SwPageFrm*)pPrv->GetPrev();
|
|
|
|
if( pPrv )
|
|
|
|
pDesc = pPrv->GetPageDesc()->GetFollow();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwDoc* pDoc = pPage->GetFmt()->GetDoc();
|
2012-06-21 13:40:06 +02:00
|
|
|
pDesc = &pDoc->GetPageDesc( 0 );
|
2001-03-02 10:21:22 +00:00
|
|
|
}
|
|
|
|
}
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pDesc, "No pagedescriptor" );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bOdd;
|
2013-08-29 17:16:44 +03:00
|
|
|
if( oPgNum )
|
|
|
|
bOdd = (oPgNum.get() % 2) ? sal_True : sal_False;
|
2001-03-02 10:21:22 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
bOdd = pPage->OnRightPage();
|
|
|
|
if( pPage->GetPrev() && ((SwPageFrm*)pPage->GetPrev())->IsEmptyPage() )
|
|
|
|
bOdd = !bOdd;
|
|
|
|
}
|
|
|
|
if( !pPage->IsEmptyPage() )
|
|
|
|
{
|
|
|
|
if( !pDesc->GetRightFmt() )
|
2011-01-17 15:06:54 +01:00
|
|
|
bOdd = sal_False;
|
2001-03-02 10:21:22 +00:00
|
|
|
else if( !pDesc->GetLeftFmt() )
|
2011-01-17 15:06:54 +01:00
|
|
|
bOdd = sal_True;
|
2001-03-02 10:21:22 +00:00
|
|
|
}
|
|
|
|
return bOdd;
|
|
|
|
}
|
|
|
|
|
2012-07-09 14:46:40 +02:00
|
|
|
bool SwFrm::OnFirstPage() const
|
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
const SwPageFrm *pPage = FindPageFrm();
|
|
|
|
|
|
|
|
if (pPage)
|
|
|
|
{
|
|
|
|
const SwPageFrm* pPrevFrm = dynamic_cast<const SwPageFrm*>(pPage->GetPrev());
|
|
|
|
if (pPrevFrm)
|
|
|
|
{
|
|
|
|
const SwPageDesc* pDesc = pPage->GetPageDesc();
|
|
|
|
bRet = pPrevFrm->GetPageDesc() != pDesc && !pDesc->IsFirstShared();
|
|
|
|
}
|
2012-10-05 18:19:41 +02:00
|
|
|
else
|
|
|
|
bRet = true;
|
2012-07-09 14:46:40 +02:00
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** @return the virtual page number with the offset. */
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 SwFrm::GetVirtPageNum() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwPageFrm *pPage = FindPageFrm();
|
|
|
|
if ( !pPage || !pPage->GetUpper() )
|
|
|
|
return 0;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nPhyPage = pPage->GetPhyPageNum();
|
2013-10-24 12:06:26 +03:00
|
|
|
if ( !(static_cast<const SwRootFrm*>(pPage->GetUpper()))->IsVirtPageNum() )
|
2000-09-18 23:08:29 +00:00
|
|
|
return nPhyPage;
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Search the nearest section using the virtual page number.
|
|
|
|
//Because searching backwards needs a lot of time we search specific using
|
|
|
|
//the dependencies. From the PageDescs we get the attributes and from the
|
|
|
|
//attributes we get the sections.
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwPageFrm *pVirtPage = 0;
|
|
|
|
const SwFrm *pFrm = 0;
|
|
|
|
const SfxItemPool &rPool = pPage->GetFmt()->GetDoc()->GetAttrPool();
|
|
|
|
const SfxPoolItem* pItem;
|
2010-10-18 22:00:21 +02:00
|
|
|
sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC );
|
|
|
|
for( sal_uInt32 n = 0; n < nMaxItems; ++n )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-10-18 22:00:21 +02:00
|
|
|
if( 0 == (pItem = rPool.GetItem2( RES_PAGEDESC, n ) ))
|
2000-09-18 23:08:29 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
const SwFmtPageDesc *pDesc = (SwFmtPageDesc*)pItem;
|
|
|
|
if ( pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
|
|
|
|
{
|
|
|
|
const SwModify *pMod = pDesc->GetDefinedIn();
|
|
|
|
SwVirtPageNumInfo aInfo( pPage );
|
|
|
|
pMod->GetInfo( aInfo );
|
|
|
|
if ( aInfo.GetPage() )
|
|
|
|
{
|
2001-03-02 10:21:22 +00:00
|
|
|
if( !pVirtPage || ( pVirtPage && aInfo.GetPage()->
|
|
|
|
GetPhyPageNum() > pVirtPage->GetPhyPageNum() ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
pVirtPage = aInfo.GetPage();
|
|
|
|
pFrm = aInfo.GetFrm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-03-02 10:21:22 +00:00
|
|
|
if ( pFrm )
|
2013-08-29 17:16:44 +03:00
|
|
|
{
|
|
|
|
::boost::optional<sal_uInt16> oNumOffset = pFrm->GetAttrSet()->GetPageDesc().GetNumOffset();
|
|
|
|
if (oNumOffset)
|
|
|
|
{
|
|
|
|
return nPhyPage - pFrm->GetPhyPageNum() + oNumOffset.get();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return nPhyPage - pFrm->GetPhyPageNum();
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
return nPhyPage;
|
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
/** Determines and sets those cells which are enclosed by the selection. */
|
2003-07-09 08:16:51 +00:00
|
|
|
bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
//Find Union-Rects and tables (Follows) of the selection.
|
2011-03-14 16:51:14 +00:00
|
|
|
OSL_ENSURE( rTblCrsr.GetCntntNode() && rTblCrsr.GetCntntNode( sal_False ),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Tabselection nicht auf Cnt." );
|
|
|
|
|
2003-07-09 08:16:51 +00:00
|
|
|
bool bRet = false;
|
|
|
|
|
2007-02-28 14:49:57 +00:00
|
|
|
// For new table models there's no need to ask the layout..
|
|
|
|
if( rTblCrsr.NewTableSelection() )
|
|
|
|
return true;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
Point aPtPt, aMkPt;
|
|
|
|
{
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
|
|
|
SwShellCrsr* pShCrsr = dynamic_cast<SwShellCrsr*>(&rTblCrsr);
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( pShCrsr )
|
|
|
|
{
|
|
|
|
aPtPt = pShCrsr->GetPtPos();
|
|
|
|
aMkPt = pShCrsr->GetMkPos();
|
|
|
|
}
|
|
|
|
}
|
2008-03-18 14:58:33 +00:00
|
|
|
|
2011-04-18 12:37:38 -03:00
|
|
|
// #151012# Made code robust here
|
2008-03-18 14:58:33 +00:00
|
|
|
const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode();
|
2011-01-17 15:06:54 +01:00
|
|
|
const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(sal_False);
|
2008-03-18 14:58:33 +00:00
|
|
|
|
2011-02-09 15:55:27 +01:00
|
|
|
const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, sal_False ) : 0;
|
|
|
|
const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, sal_False ) : 0;
|
2008-03-18 14:58:33 +00:00
|
|
|
|
|
|
|
const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0;
|
|
|
|
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pStart && pEnd, "MakeTblCrsrs: Good to have the code robust here!" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-06-12 06:38:43 +00:00
|
|
|
/* #109590# Only change table boxes if the frames are
|
|
|
|
valid. Needed because otherwise the table cursor after moving
|
|
|
|
table cells by dnd resulted in an empty tables cursor. */
|
2008-03-18 14:58:33 +00:00
|
|
|
if ( pStart && pEnd && pStart->IsValid() && pEnd->IsValid())
|
2003-06-12 06:38:43 +00:00
|
|
|
{
|
|
|
|
SwSelUnions aUnions;
|
|
|
|
::MakeSelUnions( aUnions, pStart, pEnd );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-06-12 06:38:43 +00:00
|
|
|
SwSelBoxes aNew;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bReadOnlyAvailable = rTblCrsr.IsReadOnlyAvailable();
|
2003-06-12 06:38:43 +00:00
|
|
|
|
2012-04-25 11:55:03 +02:00
|
|
|
for ( sal_uInt16 i = 0; i < aUnions.size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2012-04-25 11:55:03 +02:00
|
|
|
SwSelUnion *pUnion = &aUnions[i];
|
2003-06-12 06:38:43 +00:00
|
|
|
const SwTabFrm *pTable = pUnion->GetTable();
|
|
|
|
|
2004-05-03 12:47:58 +00:00
|
|
|
// Skip any repeated headlines in the follow:
|
|
|
|
SwLayoutFrm* pRow = pTable->IsFollow() ?
|
|
|
|
pTable->GetFirstNonHeadlineRow() :
|
|
|
|
(SwLayoutFrm*)pTable->Lower();
|
|
|
|
|
2003-06-12 06:38:43 +00:00
|
|
|
while ( pRow )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-06-12 06:38:43 +00:00
|
|
|
if ( pRow->Frm().IsOver( pUnion->GetUnion() ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-06-12 06:38:43 +00:00
|
|
|
const SwLayoutFrm *pCell = pRow->FirstCell();
|
|
|
|
|
|
|
|
while ( pCell && pRow->IsAnLower( pCell ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
OSL_ENSURE( pCell->IsCellFrm(), "Frame without cell" );
|
2003-06-12 06:38:43 +00:00
|
|
|
if( IsFrmInTblSel( pUnion->GetUnion(), pCell ) &&
|
|
|
|
(bReadOnlyAvailable ||
|
|
|
|
!pCell->GetFmt()->GetProtect().IsCntntProtected()))
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-06-12 06:38:43 +00:00
|
|
|
SwTableBox* pInsBox = (SwTableBox*)
|
|
|
|
((SwCellFrm*)pCell)->GetTabBox();
|
2012-07-19 14:03:42 +02:00
|
|
|
aNew.insert( pInsBox );
|
2003-06-12 06:38:43 +00:00
|
|
|
}
|
|
|
|
if ( pCell->GetNext() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-06-12 06:38:43 +00:00
|
|
|
pCell = (const SwLayoutFrm*)pCell->GetNext();
|
2004-01-13 10:19:26 +00:00
|
|
|
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
|
2003-06-12 06:38:43 +00:00
|
|
|
pCell = pCell->FirstCell();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwLayoutFrm* pLastCell = pCell;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
pCell = pCell->GetNextLayoutLeaf();
|
|
|
|
} while ( pCell && pLastCell->IsAnLower( pCell ) );
|
2013-08-04 17:23:08 +02:00
|
|
|
// For sections with columns
|
2003-06-12 06:38:43 +00:00
|
|
|
if( pCell && pCell->IsInTab() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-06-12 06:38:43 +00:00
|
|
|
while( !pCell->IsCellFrm() )
|
|
|
|
{
|
|
|
|
pCell = pCell->GetUpper();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCell, "Where's my cell?" );
|
2003-06-12 06:38:43 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-12 06:38:43 +00:00
|
|
|
pRow = (SwLayoutFrm*)pRow->GetNext();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-28 14:49:57 +00:00
|
|
|
rTblCrsr.ActualizeSelection( aNew );
|
2003-07-09 08:16:51 +00:00
|
|
|
bRet = true;
|
2003-06-12 06:38:43 +00:00
|
|
|
}
|
2003-07-09 08:16:51 +00:00
|
|
|
|
|
|
|
return bRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 20:59:47 +02:00
|
|
|
inline void Sub( SwRegionRects& rRegion, const SwRect& rRect )
|
|
|
|
{
|
|
|
|
if( rRect.Width() > 1 && rRect.Height() > 1 &&
|
|
|
|
rRect.IsOver( rRegion.GetOrigin() ))
|
|
|
|
rRegion -= rRect;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
/*
|
2013-08-04 17:23:08 +02:00
|
|
|
* The following situations can happen:
|
|
|
|
* 1. Start and end lie in one screen-row and in the same node
|
|
|
|
* -> one rectangle out of start and end; and we're okay
|
|
|
|
* 2. Start and end lie in one frame (therefore in the same node!)
|
|
|
|
* -> expand start to the right, end to the left and if more than two
|
|
|
|
* screen-rows are involved - calculate the in-between
|
|
|
|
* 3. Start and end lie in different frames
|
|
|
|
* -> expand start to the right until frame-end, calculate Rect
|
|
|
|
* expand end to the left until frame-start, calculate Rect
|
|
|
|
* and if more than two frames are involved add the PrtArea of all
|
|
|
|
* frames which lie in between
|
|
|
|
* 4. If it's about a table-selection we have to obtain the CellFrm for every
|
|
|
|
* PaM in the ring - its PrtArea will be added to the Rect.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2013-08-04 17:23:08 +02:00
|
|
|
* Big reorganization because of the FlyFrm - those need to be locked out.
|
|
|
|
* Exceptions: - The Fly in which the selection took place (if it took place
|
|
|
|
* in a Fly)
|
|
|
|
* - The Flys which are underrun by the text
|
|
|
|
* Functioning: First a SwRegion with a root gets initialized.
|
|
|
|
* Out of the region the inverted sections are cut out. The
|
|
|
|
* section gets compressed and finally inverted and thereby the
|
|
|
|
* inverted rectangles are available.
|
|
|
|
* In the end the Flys are cut out of the section.
|
2000-09-18 23:08:29 +00:00
|
|
|
*/
|
2013-11-18 11:29:24 +00:00
|
|
|
void SwRootFrm::CalcFrmRects(
|
|
|
|
SwShellCrsr &rCrsr,
|
|
|
|
const sal_Bool bIsTblMode)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-04-26 08:39:16 +00:00
|
|
|
SwPosition *pStartPos = rCrsr.Start(),
|
2013-06-26 12:15:55 +00:00
|
|
|
*pEndPos = rCrsr.GetPoint() == pStartPos ? rCrsr.GetMark() : rCrsr.GetPoint();
|
2007-04-26 08:39:16 +00:00
|
|
|
|
2013-10-26 19:50:13 +02:00
|
|
|
SwViewShell *pSh = GetCurrShell();
|
2004-09-08 15:10:36 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
// #i12836# enhanced pdf
|
2004-09-08 15:10:36 +00:00
|
|
|
SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ?
|
|
|
|
pSh->VisArea() :
|
|
|
|
Frm() );
|
2007-04-26 08:39:16 +00:00
|
|
|
if( !pStartPos->nNode.GetNode().IsCntntNode() ||
|
2010-06-13 15:22:56 +02:00
|
|
|
!pStartPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ||
|
2007-04-26 08:39:16 +00:00
|
|
|
( pStartPos->nNode != pEndPos->nNode &&
|
|
|
|
( !pEndPos->nNode.GetNode().IsCntntNode() ||
|
2010-06-13 15:22:56 +02:00
|
|
|
!pEndPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ) ) )
|
2007-04-26 08:39:16 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//First obtain the CntntFrms for the start and the end - those are needed
|
|
|
|
//anyway.
|
2010-12-15 09:13:59 +01:00
|
|
|
SwCntntFrm const* pStartFrm = pStartPos->nNode.GetNode().
|
2011-02-09 15:55:27 +01:00
|
|
|
GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-12-15 09:13:59 +01:00
|
|
|
SwCntntFrm const* pEndFrm = pEndPos->nNode.GetNode().
|
2011-02-09 15:55:27 +01:00
|
|
|
GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Do not subtract the FlyFrms in which selected Frames lie.
|
2004-08-02 13:13:41 +00:00
|
|
|
SwSortedObjs aSortObjs;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pStartFrm->IsInFly() )
|
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwAnchoredObject* pObj = pStartFrm->FindFlyFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pObj, "No Start Object." );
|
2010-09-30 16:31:33 +01:00
|
|
|
if (pObj) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwAnchoredObject* pObj2 = pEndFrm->FindFlyFrm();
|
2013-06-26 12:15:55 +00:00
|
|
|
OSL_ENSURE( pObj2, "SwRootFrm::CalcFrmRects(..) - FlyFrame missing - looks like an invalid selection" );
|
|
|
|
if ( pObj2 != NULL && pObj2 != pObj )
|
|
|
|
{
|
|
|
|
aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Case 4: Table selection
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bIsTblMode )
|
|
|
|
{
|
|
|
|
const SwFrm *pCell = pStartFrm->GetUpper();
|
|
|
|
while ( !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
|
|
|
SwRect aTmp( pCell->Prt() );
|
|
|
|
aTmp.Pos() += pCell->Frm().Pos();
|
|
|
|
aRegion.ChangeOrigin( aTmp );
|
2012-07-20 12:08:29 +02:00
|
|
|
aRegion.clear();
|
|
|
|
aRegion.push_back( aTmp);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
// if a selection which is not allowed exists, we correct what is not
|
|
|
|
// allowed (header/footer/table-headline) for two pages.
|
2000-09-18 23:08:29 +00:00
|
|
|
do { // middle check loop
|
|
|
|
const SwLayoutFrm* pSttLFrm = pStartFrm->GetUpper();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 cHdFtTblHd = FRM_HEADER | FRM_FOOTER | FRM_TAB;
|
2000-09-18 23:08:29 +00:00
|
|
|
while( pSttLFrm &&
|
|
|
|
! (cHdFtTblHd & pSttLFrm->GetType() ))
|
|
|
|
pSttLFrm = pSttLFrm->GetUpper();
|
|
|
|
if( !pSttLFrm )
|
|
|
|
break;
|
|
|
|
const SwLayoutFrm* pEndLFrm = pEndFrm->GetUpper();
|
|
|
|
while( pEndLFrm &&
|
|
|
|
! (cHdFtTblHd & pEndLFrm->GetType() ))
|
|
|
|
pEndLFrm = pEndLFrm->GetUpper();
|
|
|
|
if( !pEndLFrm )
|
|
|
|
break;
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pEndLFrm->GetType() == pSttLFrm->GetType(),
|
2013-08-04 17:23:08 +02:00
|
|
|
"Selection over different content" );
|
2000-09-18 23:08:29 +00:00
|
|
|
switch( pSttLFrm->GetType() )
|
|
|
|
{
|
|
|
|
case FRM_HEADER:
|
|
|
|
case FRM_FOOTER:
|
2013-08-04 17:23:08 +02:00
|
|
|
// On different pages? Then always on the start-page
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pEndLFrm->FindPageFrm() != pSttLFrm->FindPageFrm() )
|
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
// Set end- to the start-CntntFrame
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pStartPos == rCrsr.GetPoint() )
|
|
|
|
pEndFrm = pStartFrm;
|
|
|
|
else
|
|
|
|
pStartFrm = pEndFrm;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FRM_TAB:
|
2013-08-04 17:23:08 +02:00
|
|
|
// On different pages? Then check for table-headline
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwTabFrm* pTabFrm = (SwTabFrm*)pSttLFrm;
|
|
|
|
if( ( pTabFrm->GetFollow() ||
|
2013-06-26 12:15:55 +00:00
|
|
|
((SwTabFrm*)pEndLFrm)->GetFollow() ) &&
|
2004-05-03 12:47:58 +00:00
|
|
|
pTabFrm->GetTable()->GetRowsToRepeat() > 0 &&
|
2004-01-13 10:19:26 +00:00
|
|
|
pTabFrm->GetLower() != ((SwTabFrm*)pEndLFrm)->GetLower() &&
|
|
|
|
( lcl_IsInRepeatedHeadline( pStartFrm ) ||
|
2013-06-26 12:15:55 +00:00
|
|
|
lcl_IsInRepeatedHeadline( pEndFrm ) ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2013-08-04 17:23:08 +02:00
|
|
|
// Set end- to the start-CntntFrame
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pStartPos == rCrsr.GetPoint() )
|
|
|
|
pEndFrm = pStartFrm;
|
|
|
|
else
|
|
|
|
pStartFrm = pEndFrm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2013-03-03 00:44:38 +09:00
|
|
|
} while( false );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2000-11-30 10:09:18 +00:00
|
|
|
SwCrsrMoveState aTmpState( MV_NONE );
|
|
|
|
aTmpState.b2Lines = sal_True;
|
2001-09-10 14:02:49 +00:00
|
|
|
aTmpState.bNoScroll = sal_True;
|
2003-03-27 14:45:43 +00:00
|
|
|
aTmpState.nCursorBidiLevel = pStartFrm->IsRightToLeft() ? 1 : 0;
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//CntntRects to Start- and EndFrms.
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aStRect, aEndRect;
|
2000-11-30 10:09:18 +00:00
|
|
|
pStartFrm->GetCharRect( aStRect, *pStartPos, &aTmpState );
|
|
|
|
Sw2LinesPos *pSt2Pos = aTmpState.p2Lines;
|
|
|
|
aTmpState.p2Lines = NULL;
|
2003-03-27 14:45:43 +00:00
|
|
|
aTmpState.nCursorBidiLevel = pEndFrm->IsRightToLeft() ? 1 : 0;
|
|
|
|
|
2000-11-30 10:09:18 +00:00
|
|
|
pEndFrm->GetCharRect ( aEndRect, *pEndPos, &aTmpState );
|
|
|
|
Sw2LinesPos *pEnd2Pos = aTmpState.p2Lines;
|
|
|
|
|
2000-12-12 09:49:12 +00:00
|
|
|
SwRect aStFrm ( pStartFrm->UnionFrm( sal_True ) );
|
|
|
|
aStFrm.Intersection( pStartFrm->PaintArea() );
|
2013-06-26 12:15:55 +00:00
|
|
|
SwRect aEndFrm( pStartFrm == pEndFrm ? aStFrm : pEndFrm->UnionFrm( sal_True ) );
|
2000-12-12 09:49:12 +00:00
|
|
|
if( pStartFrm != pEndFrm )
|
2013-06-26 12:15:55 +00:00
|
|
|
{
|
2000-12-12 09:49:12 +00:00
|
|
|
aEndFrm.Intersection( pEndFrm->PaintArea() );
|
2013-06-26 12:15:55 +00:00
|
|
|
}
|
2001-10-23 10:42:19 +00:00
|
|
|
SWRECTFN( pStartFrm )
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bR2L = pStartFrm->IsRightToLeft();
|
|
|
|
const sal_Bool bEndR2L = pEndFrm->IsRightToLeft();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2000-11-30 10:09:18 +00:00
|
|
|
// If there's no doubleline portion involved or start and end are both
|
|
|
|
// in the same doubleline portion, all works fine, but otherwise
|
|
|
|
// we need the following...
|
2001-10-23 10:42:19 +00:00
|
|
|
if( pSt2Pos != pEnd2Pos && ( !pSt2Pos || !pEnd2Pos ||
|
|
|
|
pSt2Pos->aPortion != pEnd2Pos->aPortion ) )
|
|
|
|
{
|
|
|
|
// If we have a start(end) position inside a doubleline portion
|
|
|
|
// the surrounded part of the doubleline portion is subtracted
|
|
|
|
// from the region and the aStRect(aEndRect) is set to the
|
|
|
|
// end(start) of the doubleline portion.
|
|
|
|
if( pSt2Pos )
|
|
|
|
{
|
|
|
|
SwRect aTmp( aStRect );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2002-02-15 13:33:06 +00:00
|
|
|
// BiDi-Portions are swimming against the current.
|
2003-03-27 14:45:43 +00:00
|
|
|
const sal_Bool bPorR2L = ( MT_BIDI == pSt2Pos->nMultiType ) ?
|
2013-06-26 12:15:55 +00:00
|
|
|
! bR2L :
|
|
|
|
bR2L;
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
if( MT_BIDI == pSt2Pos->nMultiType &&
|
|
|
|
(pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
|
|
|
|
{
|
|
|
|
// nested bidi portion
|
|
|
|
long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
|
|
|
|
nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
|
|
|
|
long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
|
|
|
|
|
|
|
|
(aTmp.*fnRect->fnSetRight)( nRightAbs );
|
|
|
|
|
|
|
|
if ( ! pEnd2Pos || pEnd2Pos->aPortion != pSt2Pos->aPortion )
|
|
|
|
{
|
|
|
|
SwRect aTmp2( pSt2Pos->aPortion );
|
|
|
|
(aTmp2.*fnRect->fnSetRight)( nLeftAbs );
|
|
|
|
aTmp2.Intersection( aEndFrm );
|
|
|
|
Sub( aRegion, aTmp2 );
|
|
|
|
}
|
|
|
|
}
|
2002-02-15 13:33:06 +00:00
|
|
|
else
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
|
|
|
if( bPorR2L )
|
|
|
|
(aTmp.*fnRect->fnSetLeft)(
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
|
|
|
|
else
|
|
|
|
(aTmp.*fnRect->fnSetRight)(
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetRight)() );
|
|
|
|
}
|
|
|
|
|
2002-02-15 13:33:06 +00:00
|
|
|
if( MT_ROT_90 == pSt2Pos->nMultiType ||
|
2001-10-23 10:42:19 +00:00
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetTop)() ==
|
|
|
|
(aTmp.*fnRect->fnGetTop)() )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2001-10-23 10:42:19 +00:00
|
|
|
(aTmp.*fnRect->fnSetTop)(
|
|
|
|
(pSt2Pos->aLine.*fnRect->fnGetTop)() );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
aTmp.Intersection( aStFrm );
|
|
|
|
Sub( aRegion, aTmp );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
SwTwips nTmp = (pSt2Pos->aLine.*fnRect->fnGetBottom)();
|
2002-02-15 13:33:06 +00:00
|
|
|
if( MT_ROT_90 != pSt2Pos->nMultiType &&
|
2001-12-12 13:44:09 +00:00
|
|
|
(aStRect.*fnRect->fnBottomDist)( nTmp ) > 0 )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
|
|
|
(aTmp.*fnRect->fnSetTop)( (aTmp.*fnRect->fnGetBottom)() );
|
|
|
|
(aTmp.*fnRect->fnSetBottom)( nTmp );
|
2001-12-12 13:44:09 +00:00
|
|
|
if( (aStRect.*fnRect->fnBottomDist)(
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetBottom)() ) > 0 )
|
2002-02-15 13:33:06 +00:00
|
|
|
{
|
|
|
|
if( bPorR2L )
|
|
|
|
(aTmp.*fnRect->fnSetRight)(
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetRight)() );
|
|
|
|
else
|
|
|
|
(aTmp.*fnRect->fnSetLeft)(
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetLeft)() );
|
|
|
|
}
|
2001-10-23 10:42:19 +00:00
|
|
|
aTmp.Intersection( aStFrm );
|
|
|
|
Sub( aRegion, aTmp );
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
aStRect = pSt2Pos->aLine;
|
2002-02-15 13:33:06 +00:00
|
|
|
(aStRect.*fnRect->fnSetLeft)( bR2L ?
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetLeft)() :
|
|
|
|
(pSt2Pos->aPortion.*fnRect->fnGetRight)() );
|
2001-10-23 10:42:19 +00:00
|
|
|
(aStRect.*fnRect->fnSetWidth)( 1 );
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
if( pEnd2Pos )
|
|
|
|
{
|
2007-09-27 08:07:02 +00:00
|
|
|
SWRECTFNX( pEndFrm )
|
2001-10-23 10:42:19 +00:00
|
|
|
SwRect aTmp( aEndRect );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
// BiDi-Portions are swimming against the current.
|
|
|
|
const sal_Bool bPorR2L = ( MT_BIDI == pEnd2Pos->nMultiType ) ?
|
|
|
|
! bEndR2L :
|
|
|
|
bEndR2L;
|
|
|
|
|
|
|
|
if( MT_BIDI == pEnd2Pos->nMultiType &&
|
2007-09-27 08:07:02 +00:00
|
|
|
(pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
|
|
|
// nested bidi portion
|
2007-09-27 08:07:02 +00:00
|
|
|
long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)();
|
|
|
|
nRightAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)();
|
|
|
|
long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetLeft)( nLeftAbs );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
if ( ! pSt2Pos || pSt2Pos->aPortion != pEnd2Pos->aPortion )
|
|
|
|
{
|
|
|
|
SwRect aTmp2( pEnd2Pos->aPortion );
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp2.*fnRectX->fnSetLeft)( nRightAbs );
|
2003-03-27 14:45:43 +00:00
|
|
|
aTmp2.Intersection( aEndFrm );
|
|
|
|
Sub( aRegion, aTmp2 );
|
|
|
|
}
|
|
|
|
}
|
2002-02-15 13:33:06 +00:00
|
|
|
else
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
|
|
|
if ( bPorR2L )
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetRight)(
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
|
2003-03-27 14:45:43 +00:00
|
|
|
else
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetLeft)(
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
|
2002-02-15 13:33:06 +00:00
|
|
|
if( MT_ROT_90 == pEnd2Pos->nMultiType ||
|
2007-09-27 08:07:02 +00:00
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetBottom)() ==
|
|
|
|
(aEndRect.*fnRectX->fnGetBottom)() )
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetBottom)(
|
|
|
|
(pEnd2Pos->aLine.*fnRectX->fnGetBottom)() );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
aTmp.Intersection( aEndFrm );
|
|
|
|
Sub( aRegion, aTmp );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2002-02-15 13:33:06 +00:00
|
|
|
// The next statement means neither ruby nor rotate(90):
|
|
|
|
if( !( MT_RUBY & pEnd2Pos->nMultiType ) )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
2007-09-27 08:07:02 +00:00
|
|
|
SwTwips nTmp = (pEnd2Pos->aLine.*fnRectX->fnGetTop)();
|
|
|
|
if( (aEndRect.*fnRectX->fnGetTop)() != nTmp )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetBottom)(
|
|
|
|
(aTmp.*fnRectX->fnGetTop)() );
|
|
|
|
(aTmp.*fnRectX->fnSetTop)( nTmp );
|
|
|
|
if( (aEndRect.*fnRectX->fnGetTop)() !=
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetTop)() )
|
2010-11-06 11:01:46 -05:00
|
|
|
{
|
|
|
|
if( bPorR2L )
|
|
|
|
(aTmp.*fnRectX->fnSetLeft)(
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
|
|
|
|
else
|
|
|
|
(aTmp.*fnRectX->fnSetRight)(
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetRight)() );
|
|
|
|
}
|
2001-10-23 10:42:19 +00:00
|
|
|
aTmp.Intersection( aEndFrm );
|
|
|
|
Sub( aRegion, aTmp );
|
|
|
|
}
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
aEndRect = pEnd2Pos->aLine;
|
2007-09-27 08:07:02 +00:00
|
|
|
(aEndRect.*fnRectX->fnSetLeft)( bEndR2L ?
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetRight)() :
|
|
|
|
(pEnd2Pos->aPortion.*fnRectX->fnGetLeft)() );
|
|
|
|
(aEndRect.*fnRectX->fnSetWidth)( 1 );
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
else if( pSt2Pos && pEnd2Pos &&
|
|
|
|
MT_BIDI == pSt2Pos->nMultiType &&
|
|
|
|
MT_BIDI == pEnd2Pos->nMultiType &&
|
|
|
|
pSt2Pos->aPortion == pEnd2Pos->aPortion &&
|
|
|
|
pSt2Pos->aPortion2 != pEnd2Pos->aPortion2 )
|
2000-11-30 10:09:18 +00:00
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
// This is the ugly special case, where the selection starts and
|
|
|
|
// ends in the same bidi portion but one start or end is inside a
|
|
|
|
// nested bidi portion.
|
|
|
|
|
|
|
|
if ( (pSt2Pos->aPortion2.*fnRect->fnGetWidth)() )
|
2000-11-30 10:09:18 +00:00
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
SwRect aTmp( aStRect );
|
|
|
|
long nRightAbs = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
|
|
|
|
nRightAbs -= (pSt2Pos->aPortion2.*fnRect->fnGetLeft)();
|
|
|
|
long nLeftAbs = nRightAbs - (pSt2Pos->aPortion2.*fnRect->fnGetWidth)();
|
|
|
|
|
|
|
|
(aTmp.*fnRect->fnSetRight)( nRightAbs );
|
2000-11-30 13:11:05 +00:00
|
|
|
aTmp.Intersection( aStFrm );
|
2000-11-30 10:09:18 +00:00
|
|
|
Sub( aRegion, aTmp );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
aStRect = pSt2Pos->aLine;
|
|
|
|
(aStRect.*fnRect->fnSetLeft)( bR2L ? nRightAbs : nLeftAbs );
|
|
|
|
(aStRect.*fnRect->fnSetWidth)( 1 );
|
2000-11-30 10:09:18 +00:00
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2007-09-27 08:07:02 +00:00
|
|
|
SWRECTFNX( pEndFrm )
|
|
|
|
if ( (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)() )
|
2000-11-30 10:09:18 +00:00
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
SwRect aTmp( aEndRect );
|
2007-09-27 08:07:02 +00:00
|
|
|
long nRightAbs = (pEnd2Pos->aPortion.*fnRectX->fnGetRight)();
|
|
|
|
nRightAbs -= (pEnd2Pos->aPortion2.*fnRectX->fnGetLeft)();
|
|
|
|
long nLeftAbs = nRightAbs - (pEnd2Pos->aPortion2.*fnRectX->fnGetWidth)();
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2007-09-27 08:07:02 +00:00
|
|
|
(aTmp.*fnRectX->fnSetLeft)( nLeftAbs );
|
2000-11-30 13:11:05 +00:00
|
|
|
aTmp.Intersection( aEndFrm );
|
2000-11-30 10:09:18 +00:00
|
|
|
Sub( aRegion, aTmp );
|
2003-03-27 14:45:43 +00:00
|
|
|
|
|
|
|
aEndRect = pEnd2Pos->aLine;
|
2007-09-27 08:07:02 +00:00
|
|
|
(aEndRect.*fnRectX->fnSetLeft)( bEndR2L ? nLeftAbs : nRightAbs );
|
|
|
|
(aEndRect.*fnRectX->fnSetWidth)( 1 );
|
2000-11-30 10:09:18 +00:00
|
|
|
}
|
|
|
|
}
|
2003-03-27 14:45:43 +00:00
|
|
|
|
2000-11-30 13:11:05 +00:00
|
|
|
// The charrect may be outside the paintarea (for cursortravelling)
|
|
|
|
// but the selection has to be restricted to the paintarea
|
|
|
|
if( aStRect.Left() < aStFrm.Left() )
|
|
|
|
aStRect.Left( aStFrm.Left() );
|
|
|
|
else if( aStRect.Left() > aStFrm.Right() )
|
|
|
|
aStRect.Left( aStFrm.Right() );
|
|
|
|
SwTwips nTmp = aStRect.Right();
|
|
|
|
if( nTmp < aStFrm.Left() )
|
|
|
|
aStRect.Right( aStFrm.Left() );
|
|
|
|
else if( nTmp > aStFrm.Right() )
|
|
|
|
aStRect.Right( aStFrm.Right() );
|
|
|
|
if( aEndRect.Left() < aEndFrm.Left() )
|
|
|
|
aEndRect.Left( aEndFrm.Left() );
|
|
|
|
else if( aEndRect.Left() > aEndFrm.Right() )
|
|
|
|
aEndRect.Left( aEndFrm.Right() );
|
|
|
|
nTmp = aEndRect.Right();
|
|
|
|
if( nTmp < aEndFrm.Left() )
|
|
|
|
aEndRect.Right( aEndFrm.Left() );
|
|
|
|
else if( nTmp > aEndFrm.Right() )
|
|
|
|
aEndRect.Right( aEndFrm.Right() );
|
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
if( pStartFrm == pEndFrm )
|
|
|
|
{
|
2002-02-15 13:33:06 +00:00
|
|
|
sal_Bool bSameRotatedOrBidi = pSt2Pos && pEnd2Pos &&
|
|
|
|
( MT_BIDI & pSt2Pos->nMultiType ) &&
|
2001-10-23 10:42:19 +00:00
|
|
|
pSt2Pos->aPortion == pEnd2Pos->aPortion;
|
|
|
|
//case 1: (Same frame and same row)
|
2002-02-15 13:33:06 +00:00
|
|
|
if( bSameRotatedOrBidi ||
|
2001-10-23 10:42:19 +00:00
|
|
|
(aStRect.*fnRect->fnGetTop)() == (aEndRect.*fnRect->fnGetTop)() )
|
|
|
|
{
|
|
|
|
Point aTmpSt( aStRect.Pos() );
|
|
|
|
Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() );
|
2002-02-15 13:33:06 +00:00
|
|
|
if( bSameRotatedOrBidi || bR2L )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
2001-11-14 13:41:25 +00:00
|
|
|
if( aTmpSt.Y() > aTmpEnd.Y() )
|
|
|
|
{
|
|
|
|
long nTmpY = aTmpEnd.Y();
|
|
|
|
aTmpEnd.Y() = aTmpSt.Y();
|
|
|
|
aTmpSt.Y() = nTmpY;
|
|
|
|
}
|
|
|
|
if( aTmpSt.X() > aTmpEnd.X() )
|
|
|
|
{
|
|
|
|
long nTmpX = aTmpEnd.X();
|
|
|
|
aTmpEnd.X() = aTmpSt.X();
|
|
|
|
aTmpSt.X() = nTmpX;
|
|
|
|
}
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SwRect aTmp = SwRect( aTmpSt, aTmpEnd );
|
2013-08-04 17:23:08 +02:00
|
|
|
// Bug 34888: If content is selected which doesn't take space
|
|
|
|
// away (i.e. PostIts, RefMarks, TOXMarks), then at
|
|
|
|
// least set the width of the Crsr.
|
2001-10-23 10:42:19 +00:00
|
|
|
if( 1 == (aTmp.*fnRect->fnGetWidth)() &&
|
|
|
|
pStartPos->nContent.GetIndex() !=
|
|
|
|
pEndPos->nContent.GetIndex() )
|
|
|
|
{
|
|
|
|
OutputDevice* pOut = pSh->GetOut();
|
|
|
|
long nCrsrWidth = pOut->GetSettings().GetStyleSettings().
|
2013-06-26 12:15:55 +00:00
|
|
|
GetCursorSize();
|
2001-10-23 10:42:19 +00:00
|
|
|
(aTmp.*fnRect->fnSetWidth)( pOut->PixelToLogic(
|
2013-06-26 12:15:55 +00:00
|
|
|
Size( nCrsrWidth, 0 ) ).Width() );
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
aTmp.Intersection( aStFrm );
|
|
|
|
Sub( aRegion, aTmp );
|
|
|
|
}
|
|
|
|
//case 2: (Same frame, but not the same line)
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwTwips lLeft, lRight;
|
|
|
|
if( pSt2Pos && pEnd2Pos && pSt2Pos->aPortion == pEnd2Pos->aPortion )
|
|
|
|
{
|
|
|
|
lLeft = (pSt2Pos->aPortion.*fnRect->fnGetLeft)();
|
|
|
|
lRight = (pSt2Pos->aPortion.*fnRect->fnGetRight)();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
lLeft = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
|
2013-06-26 12:15:55 +00:00
|
|
|
(pStartFrm->Prt().*fnRect->fnGetLeft)();
|
2001-10-23 10:42:19 +00:00
|
|
|
lRight = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
|
2013-06-26 12:15:55 +00:00
|
|
|
(pStartFrm->Prt().*fnRect->fnGetRight)();
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
if( lLeft < (aStFrm.*fnRect->fnGetLeft)() )
|
|
|
|
lLeft = (aStFrm.*fnRect->fnGetLeft)();
|
|
|
|
if( lRight > (aStFrm.*fnRect->fnGetRight)() )
|
|
|
|
lRight = (aStFrm.*fnRect->fnGetRight)();
|
|
|
|
SwRect aSubRect( aStRect );
|
|
|
|
//First line
|
2002-02-15 13:33:06 +00:00
|
|
|
if( bR2L )
|
|
|
|
(aSubRect.*fnRect->fnSetLeft)( lLeft );
|
|
|
|
else
|
|
|
|
(aSubRect.*fnRect->fnSetRight)( lRight );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
|
|
|
|
//If there's at least a twips between start- and endline,
|
|
|
|
//so the whole area between will be added.
|
|
|
|
SwTwips aTmpBottom = (aStRect.*fnRect->fnGetBottom)();
|
|
|
|
SwTwips aTmpTop = (aEndRect.*fnRect->fnGetTop)();
|
|
|
|
if( aTmpBottom != aTmpTop )
|
|
|
|
{
|
|
|
|
(aSubRect.*fnRect->fnSetLeft)( lLeft );
|
|
|
|
(aSubRect.*fnRect->fnSetRight)( lRight );
|
|
|
|
(aSubRect.*fnRect->fnSetTop)( aTmpBottom );
|
2002-08-19 10:16:14 +00:00
|
|
|
(aSubRect.*fnRect->fnSetBottom)( aTmpTop );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
}
|
|
|
|
//and the last line
|
|
|
|
aSubRect = aEndRect;
|
2002-02-15 13:33:06 +00:00
|
|
|
if( bR2L )
|
|
|
|
(aSubRect.*fnRect->fnSetRight)( lRight );
|
|
|
|
else
|
|
|
|
(aSubRect.*fnRect->fnSetLeft)( lLeft );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
}
|
|
|
|
}
|
2013-08-04 17:23:08 +02:00
|
|
|
//case 3: (Different frames, maybe with other frames between)
|
2001-10-23 10:42:19 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
//The startframe first...
|
|
|
|
SwRect aSubRect( aStRect );
|
2002-02-15 13:33:06 +00:00
|
|
|
if( bR2L )
|
|
|
|
(aSubRect.*fnRect->fnSetLeft)( (aStFrm.*fnRect->fnGetLeft)());
|
|
|
|
else
|
|
|
|
(aSubRect.*fnRect->fnSetRight)( (aStFrm.*fnRect->fnGetRight)());
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
2007-09-27 08:07:02 +00:00
|
|
|
SwTwips nTmpTwips = (aStRect.*fnRect->fnGetBottom)();
|
|
|
|
if( (aStFrm.*fnRect->fnGetBottom)() != nTmpTwips )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
|
|
|
aSubRect = aStFrm;
|
2007-09-27 08:07:02 +00:00
|
|
|
(aSubRect.*fnRect->fnSetTop)( nTmpTwips );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
}
|
|
|
|
|
|
|
|
//Now the frames between, if there are any
|
2012-11-19 16:43:09 +01:00
|
|
|
bool const bBody = pStartFrm->IsInDocBody();
|
2004-01-13 10:19:26 +00:00
|
|
|
const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ?
|
2013-06-26 12:15:55 +00:00
|
|
|
((SwCellFrm*)pStartFrm->GetUpper())->GetTabBox() : 0;
|
2013-09-16 12:12:42 +02:00
|
|
|
if (pSh->IsSelectAll())
|
|
|
|
pCellBox = 0;
|
|
|
|
|
2001-10-23 10:42:19 +00:00
|
|
|
const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
|
|
|
|
SwRect aPrvRect;
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCntnt,
|
2013-06-26 12:15:55 +00:00
|
|
|
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
|
2006-02-06 16:21:01 +00:00
|
|
|
while ( pCntnt && pCntnt != pEndFrm )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
|
|
|
if ( pCntnt->IsInFly() )
|
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwAnchoredObject* pObj = pCntnt->FindFlyFrm();
|
|
|
|
aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) );
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 10:19:26 +00:00
|
|
|
// Consider only frames which have the same IsInDocBody value like pStartFrm
|
|
|
|
// If pStartFrm is inside a SwCellFrm, consider only frames which are inside the
|
|
|
|
// same cell frame (or its follow cell)
|
|
|
|
const SwTableBox* pTmpCellBox = pCntnt->GetUpper()->IsCellFrm() ?
|
2013-06-26 12:15:55 +00:00
|
|
|
((SwCellFrm*)pCntnt->GetUpper())->GetTabBox() : 0;
|
2013-09-16 12:12:42 +02:00
|
|
|
if (pSh->IsSelectAll())
|
|
|
|
pTmpCellBox = 0;
|
2004-01-13 10:19:26 +00:00
|
|
|
if ( bBody == pCntnt->IsInDocBody() &&
|
2005-03-23 10:53:58 +00:00
|
|
|
( !pCellBox || pCellBox == pTmpCellBox ) )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
|
|
|
SwRect aCRect( pCntnt->UnionFrm( sal_True ) );
|
|
|
|
aCRect.Intersection( pCntnt->PaintArea() );
|
|
|
|
if( aCRect.IsOver( aRegion.GetOrigin() ))
|
|
|
|
{
|
|
|
|
SwRect aTmp( aPrvRect );
|
|
|
|
aTmp.Union( aCRect );
|
|
|
|
if ( (aPrvRect.Height() * aPrvRect.Width() +
|
|
|
|
aCRect.Height() * aCRect.Width()) ==
|
|
|
|
(aTmp.Height() * aTmp.Width()) )
|
|
|
|
{
|
|
|
|
aPrvRect.Union( aCRect );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( aPrvRect.HasArea() )
|
|
|
|
Sub( aRegion, aPrvRect );
|
|
|
|
aPrvRect = aCRect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pCntnt = pCntnt->GetNextCntntFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCntnt,
|
2013-08-09 20:59:47 +02:00
|
|
|
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect!" );
|
2001-10-23 10:42:19 +00:00
|
|
|
}
|
|
|
|
if ( aPrvRect.HasArea() )
|
|
|
|
Sub( aRegion, aPrvRect );
|
|
|
|
|
|
|
|
//At least the endframe...
|
|
|
|
bVert = pEndFrm->IsVertical();
|
|
|
|
bRev = pEndFrm->IsReverse();
|
2009-03-04 16:19:59 +00:00
|
|
|
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
|
|
|
|
fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) :
|
2013-06-26 12:15:55 +00:00
|
|
|
( bRev ? fnRectB2T : fnRectHori );
|
2007-09-27 08:07:02 +00:00
|
|
|
nTmpTwips = (aEndRect.*fnRect->fnGetTop)();
|
|
|
|
if( (aEndFrm.*fnRect->fnGetTop)() != nTmpTwips )
|
2001-10-23 10:42:19 +00:00
|
|
|
{
|
|
|
|
aSubRect = aEndFrm;
|
2007-09-27 08:07:02 +00:00
|
|
|
(aSubRect.*fnRect->fnSetBottom)( nTmpTwips );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
}
|
|
|
|
aSubRect = aEndRect;
|
2003-03-27 14:45:43 +00:00
|
|
|
if( bEndR2L )
|
2002-02-15 13:33:06 +00:00
|
|
|
(aSubRect.*fnRect->fnSetRight)((aEndFrm.*fnRect->fnGetRight)());
|
|
|
|
else
|
|
|
|
(aSubRect.*fnRect->fnSetLeft)( (aEndFrm.*fnRect->fnGetLeft)() );
|
2001-10-23 10:42:19 +00:00
|
|
|
Sub( aRegion, aSubRect );
|
|
|
|
}
|
2001-01-29 11:34:40 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
aRegion.Invert();
|
2000-11-30 10:09:18 +00:00
|
|
|
delete pSt2Pos;
|
|
|
|
delete pEnd2Pos;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
// Cut out Flys during loop. We don't cut out Flys when:
|
|
|
|
// - the Lower is StartFrm/EndFrm (FlyInCnt and all other Flys which again
|
|
|
|
// sit in it)
|
|
|
|
// - if in the Z-order we have Flys above those in which the StartFrm is
|
|
|
|
// placed
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwPageFrm *pPage = pStartFrm->FindPageFrm();
|
|
|
|
const SwPageFrm *pEndPage = pEndFrm->FindPageFrm();
|
2006-08-14 15:30:04 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pPage )
|
|
|
|
{
|
|
|
|
if ( pPage->GetSortedObjs() )
|
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
SwAnchoredObject* pAnchoredObj = rObjs[i];
|
|
|
|
if ( !pAnchoredObj->ISA(SwFlyFrm) )
|
2000-09-18 23:08:29 +00:00
|
|
|
continue;
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwFlyFrm* pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
|
|
|
|
const SwVirtFlyDrawObj* pObj = pFly->GetVirtDrawObj();
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
|
|
|
|
if ( !pFly->IsAnLower( pStartFrm ) &&
|
2013-06-26 12:15:55 +00:00
|
|
|
(rSur.GetSurround() != SURROUND_THROUGHT &&
|
|
|
|
!rSur.IsContour()) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-08-02 13:13:41 +00:00
|
|
|
if ( aSortObjs.Contains( *pAnchoredObj ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
continue;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bSub = sal_True;
|
|
|
|
const sal_uInt32 nPos = pObj->GetOrdNum();
|
|
|
|
for ( sal_uInt16 k = 0; bSub && k < aSortObjs.Count(); ++k )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( aSortObjs[k]->ISA(SwFlyFrm),
|
2013-06-26 12:15:55 +00:00
|
|
|
"<SwRootFrm::CalcFrmRects(..)> - object in <aSortObjs> of unexcepted type" );
|
2004-08-02 13:13:41 +00:00
|
|
|
const SwFlyFrm* pTmp = static_cast<SwFlyFrm*>(aSortObjs[k]);
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
2013-06-26 12:15:55 +00:00
|
|
|
{
|
|
|
|
if ( nPos < pTmp->GetVirtDrawObj()->GetOrdNumDirect() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bSub = sal_False;
|
2013-06-26 12:15:55 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2013-06-26 12:15:55 +00:00
|
|
|
{
|
2004-06-28 12:41:51 +00:00
|
|
|
pTmp = pTmp->GetAnchorFrm()->FindFlyFrm();
|
2013-06-26 12:15:55 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
} while ( bSub && pTmp );
|
|
|
|
}
|
|
|
|
if ( bSub )
|
|
|
|
Sub( aRegion, pFly->Frm() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pPage == pEndPage )
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
}
|
|
|
|
|
2013-08-04 17:23:08 +02:00
|
|
|
//Because it looks better, we close the DropCaps.
|
2000-09-18 23:08:29 +00:00
|
|
|
SwRect aDropRect;
|
|
|
|
if ( pStartFrm->IsTxtFrm() )
|
|
|
|
{
|
|
|
|
if ( ((SwTxtFrm*)pStartFrm)->GetDropRect( aDropRect ) )
|
|
|
|
Sub( aRegion, aDropRect );
|
|
|
|
}
|
|
|
|
if ( pEndFrm != pStartFrm && pEndFrm->IsTxtFrm() )
|
|
|
|
{
|
|
|
|
if ( ((SwTxtFrm*)pEndFrm)->GetDropRect( aDropRect ) )
|
|
|
|
Sub( aRegion, aDropRect );
|
|
|
|
}
|
|
|
|
|
2012-07-20 12:08:29 +02:00
|
|
|
rCrsr.assign( aRegion.begin(), aRegion.end() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|