2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:45:29 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 20:19:29 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <txtftn.hxx>
|
|
|
|
#include <fmtftn.hxx>
|
|
|
|
#include <ftnidx.hxx>
|
2001-10-15 11:50:20 +00:00
|
|
|
#include <pagefrm.hxx>
|
|
|
|
#include <colfrm.hxx>
|
|
|
|
#include <rootfrm.hxx>
|
|
|
|
#include <cntfrm.hxx>
|
|
|
|
#include <doc.hxx>
|
|
|
|
#include <ndtxt.hxx>
|
|
|
|
#include <frmtool.hxx>
|
|
|
|
#include <swtable.hxx>
|
|
|
|
#include <ftnfrm.hxx>
|
|
|
|
#include <txtfrm.hxx>
|
|
|
|
#include <tabfrm.hxx>
|
|
|
|
#include <pagedesc.hxx>
|
|
|
|
#include <ftninfo.hxx>
|
|
|
|
#include <ndindex.hxx>
|
|
|
|
#include <sectfrm.hxx>
|
|
|
|
#include <pam.hxx>
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383#
|
|
|
|
#include <objectformatter.hxx>
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* lcl_FindFtnPos() Sucht die Position des Attributes im FtnArray am
|
|
|
|
|* Dokument, dort stehen die Fussnoten gluecklicherweise nach ihrem
|
|
|
|
|* Index sortiert.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
#define ENDNOTE 0x80000000
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong MA_FASTCALL lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwFtnIdxs &rFtnIdxs = pDoc->GetFtnIdxs();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nRet;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTxtFtnPtr pBla = (SwTxtFtn*)pAttr;
|
|
|
|
if ( rFtnIdxs.Seek_Entry( pBla, &nRet ) )
|
|
|
|
{
|
|
|
|
if( pAttr->GetFtn().IsEndNote() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_uLong(nRet) + ENDNOTE;
|
2000-09-18 23:08:29 +00:00
|
|
|
return nRet;
|
|
|
|
}
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pDoc, "FtnPos not found." );
|
2000-09-18 23:08:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwDoc* pDoc = GetFmt()->GetDoc();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pDoc, "SwFtnFrm: Missing doc!" );
|
2000-09-18 23:08:29 +00:00
|
|
|
return lcl_FindFtnPos( pDoc, GetAttr() ) <
|
|
|
|
lcl_FindFtnPos( pDoc, pTxtFtn );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
2011-01-17 15:06:54 +01:00
|
|
|
|* sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* pBoss, SwPageFrm* pPage)
|
2000-09-18 23:08:29 +00:00
|
|
|
|* setzt pBoss auf den naechsten SwFtnBossFrm, das kann entweder eine Spalte
|
|
|
|
|* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird
|
2011-01-17 15:06:54 +01:00
|
|
|
|* enthaelt pPage die neue Seite und die Funktion liefert sal_True.
|
2000-09-18 23:08:29 +00:00
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
|
|
|
|
sal_Bool bDontLeave )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( rpBoss->IsColumnFrm() )
|
|
|
|
{
|
|
|
|
if( rpBoss->GetNext() )
|
|
|
|
{
|
|
|
|
rpBoss = (SwFtnBossFrm*)rpBoss->GetNext(); //naechste Spalte
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( rpBoss->IsInSct() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pSct = rpBoss->FindSctFrm()->GetFollow();
|
|
|
|
if( pSct )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSct->Lower() && pSct->Lower()->IsColumnFrm(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Where's the column?" );
|
|
|
|
rpBoss = (SwColumnFrm*)pSct->Lower();
|
|
|
|
SwPageFrm* pOld = rpPage;
|
|
|
|
rpPage = pSct->FindPageFrm();
|
|
|
|
return pOld != rpPage;
|
|
|
|
}
|
|
|
|
else if( bDontLeave )
|
|
|
|
{
|
|
|
|
rpPage = NULL;
|
|
|
|
rpBoss = NULL;
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rpPage = (SwPageFrm*)rpPage->GetNext(); // naechste Seite
|
|
|
|
rpBoss = rpPage;
|
|
|
|
if( rpPage )
|
|
|
|
{
|
|
|
|
SwLayoutFrm* pBody = rpPage->FindBodyCont();
|
|
|
|
if( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
|
|
|
rpBoss = (SwFtnBossFrm*)pBody->Lower(); // erste Spalte
|
|
|
|
}
|
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_uInt16 lcl_ColumnNum( SwFrm* pBoss )
|
2000-09-18 23:08:29 +00:00
|
|
|
|* liefert die Spaltennummer, wenn pBoss eine Spalte ist,
|
|
|
|
|* sonst eine Null (bei Seiten).
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nRet = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pBoss->IsColumnFrm() )
|
|
|
|
return 0;
|
|
|
|
const SwFrm* pCol;
|
|
|
|
if( pBoss->IsInSct() )
|
|
|
|
{
|
|
|
|
pCol = pBoss->GetUpper()->FindColFrm();
|
|
|
|
if( pBoss->GetNext() || pBoss->GetPrev() )
|
|
|
|
{
|
|
|
|
while( pBoss )
|
|
|
|
{
|
|
|
|
++nRet; // Section columns
|
|
|
|
pBoss = pBoss->GetPrev();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCol = pBoss;
|
|
|
|
while( pCol )
|
|
|
|
{
|
|
|
|
nRet += 256; // Page columns
|
|
|
|
pCol = pCol->GetPrev();
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnContFrm::SwFtnContFrm()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt ):
|
|
|
|
SwLayoutFrm( pFmt )
|
|
|
|
{
|
2001-08-23 13:41:20 +00:00
|
|
|
nType = FRMC_FTNCONT;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// lcl_Undersize(..) klappert einen SwFrm und dessen Inneres ab
|
|
|
|
// und liefert die Summe aller TxtFrm-Vergroesserungswuensche
|
|
|
|
|
|
|
|
long lcl_Undersize( const SwFrm* pFrm )
|
|
|
|
{
|
|
|
|
long nRet = 0;
|
2001-10-08 13:10:07 +00:00
|
|
|
SWRECTFN( pFrm )
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pFrm->IsTxtFrm() )
|
|
|
|
{
|
|
|
|
if( ((SwTxtFrm*)pFrm)->IsUndersized() )
|
2001-10-08 13:10:07 +00:00
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
// Dieser TxtFrm waere gern ein bisschen groesser
|
2001-10-08 13:10:07 +00:00
|
|
|
nRet = ((SwTxtFrm*)pFrm)->GetParHeight() -
|
|
|
|
(pFrm->Prt().*fnRect->fnGetHeight)();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( nRet < 0 )
|
|
|
|
nRet = 0;
|
2001-10-08 13:10:07 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else if( pFrm->IsLayoutFrm() )
|
|
|
|
{
|
|
|
|
const SwFrm* pNxt = ((SwLayoutFrm*)pFrm)->Lower();
|
|
|
|
while( pNxt )
|
|
|
|
{
|
|
|
|
nRet += lcl_Undersize( pNxt );
|
|
|
|
pNxt = pNxt->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnContFrm::Format()
|
|
|
|
|*
|
|
|
|
|* Beschreibung: "Formatiert" den Frame;
|
|
|
|
|* Die Fixsize wird hier nicht eingestellt.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnContFrm::Format( const SwBorderAttrs * )
|
|
|
|
{
|
|
|
|
//GesamtBorder ermitteln, es gibt nur einen Abstand nach oben.
|
|
|
|
const SwPageFrm* pPage = FindPageFrm();
|
|
|
|
const SwPageFtnInfo &rInf = pPage->GetPageDesc()->GetFtnInfo();
|
|
|
|
const SwTwips nBorder = rInf.GetTopDist() + rInf.GetBottomDist() +
|
|
|
|
rInf.GetLineWidth();
|
2001-10-08 13:10:07 +00:00
|
|
|
SWRECTFN( this )
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !bValidPrtArea )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bValidPrtArea = sal_True;
|
2001-10-08 13:10:07 +00:00
|
|
|
(Prt().*fnRect->fnSetTop)( nBorder );
|
|
|
|
(Prt().*fnRect->fnSetWidth)( (Frm().*fnRect->fnGetWidth)() );
|
|
|
|
(Prt().*fnRect->fnSetHeight)((Frm().*fnRect->fnGetHeight)() - nBorder );
|
|
|
|
if( (Prt().*fnRect->fnGetHeight)() < 0 && !pPage->IsFtnPage() )
|
2011-01-17 15:06:54 +01:00
|
|
|
bValidSize = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bValidSize )
|
|
|
|
{
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
|
2011-01-17 15:06:54 +01:00
|
|
|
Grow( LONG_MAX, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
//Die Groesse in der VarSize wird durch den Inhalt plus den
|
|
|
|
//Raendern bestimmt.
|
|
|
|
SwTwips nRemaining = 0;
|
|
|
|
SwFrm *pFrm = pLower;
|
|
|
|
while ( pFrm )
|
|
|
|
{ // lcl_Undersize(..) beruecksichtigt (rekursiv) TxtFrms, die gerne
|
|
|
|
// groesser waeren. Diese entstehen insbesondere in spaltigen Rahmen,
|
|
|
|
// wenn diese noch nicht ihre maximale Groesse haben.
|
2001-10-08 13:10:07 +00:00
|
|
|
nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)()
|
|
|
|
+ lcl_Undersize( pFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
}
|
|
|
|
//Jetzt noch den Rand addieren
|
|
|
|
nRemaining += nBorder;
|
|
|
|
|
|
|
|
SwTwips nDiff;
|
|
|
|
if( IsInSct() )
|
|
|
|
{
|
2001-12-12 13:44:09 +00:00
|
|
|
nDiff = -(Frm().*fnRect->fnBottomDist)(
|
|
|
|
(GetUpper()->*fnRect->fnGetPrtBottom)() );
|
2001-11-22 08:36:37 +00:00
|
|
|
if( nDiff > 0 )
|
|
|
|
{
|
|
|
|
if( nDiff > (Frm().*fnRect->fnGetHeight)() )
|
|
|
|
nDiff = (Frm().*fnRect->fnGetHeight)();
|
|
|
|
(Frm().*fnRect->fnAddBottom)( -nDiff );
|
|
|
|
(Prt().*fnRect->fnAddHeight)( -nDiff );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2001-10-08 13:10:07 +00:00
|
|
|
nDiff = (Frm().*fnRect->fnGetHeight)() - nRemaining;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nDiff > 0 )
|
2007-02-28 14:48:08 +00:00
|
|
|
Shrink( nDiff );
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( nDiff < 0 )
|
|
|
|
{
|
2007-02-28 14:48:08 +00:00
|
|
|
Grow( -nDiff );
|
2000-09-18 23:08:29 +00:00
|
|
|
//Es kann passieren, dass weniger Platz zur Verfuegung steht,
|
|
|
|
//als der bereits der Border benoetigt - die Groesse der
|
|
|
|
//PrtArea wird dann negativ.
|
2001-10-08 13:10:07 +00:00
|
|
|
SwTwips nPrtHeight = (Prt().*fnRect->fnGetHeight)();
|
|
|
|
if( nPrtHeight < 0 )
|
|
|
|
{
|
2007-09-27 08:03:19 +00:00
|
|
|
const SwTwips nTmpDiff = Max( (Prt().*fnRect->fnGetTop)(),
|
2001-10-08 13:10:07 +00:00
|
|
|
-nPrtHeight );
|
2007-09-27 08:03:19 +00:00
|
|
|
(Prt().*fnRect->fnSubTop)( nTmpDiff );
|
2001-10-08 13:10:07 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
bValidSize = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnContFrm::GrowFrm(), ShrinkFrm()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//Keine Pruefung ob FixSize oder nicht, die FtnContainer sind immer bis
|
|
|
|
//zur Maximalhoehe variabel.
|
|
|
|
//Wenn die Maximalhoehe LONG_MAX ist, so nehmen wir uns soviel Platz wie eben
|
|
|
|
//moeglich.
|
|
|
|
//Wenn die Seite eine spezielle Fussnotenseite ist, so nehmen wir uns auch
|
|
|
|
//soviel Platz wie eben moeglich.
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !GetUpper() || !GetUpper()->IsFtnBossFrm() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !this, "Keine FtnBoss." );
|
2000-09-18 23:08:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-10-19 09:25:19 +00:00
|
|
|
SWRECTFN( this )
|
|
|
|
if( (Frm().*fnRect->fnGetHeight)() > 0 &&
|
|
|
|
nDist > ( LONG_MAX - (Frm().*fnRect->fnGetHeight)() ) )
|
|
|
|
nDist = LONG_MAX - (Frm().*fnRect->fnGetHeight)();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwFtnBossFrm *pBoss = (SwFtnBossFrm*)GetUpper();
|
|
|
|
if( IsInSct() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pSect = FindSctFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSect, "GrowFrm: Missing SectFrm" );
|
2000-09-18 23:08:29 +00:00
|
|
|
// In a section, which has to maximize, a footnotecontainer is allowed
|
|
|
|
// to grow, when the section can't grow anymore.
|
|
|
|
if( !bTst && !pSect->IsColLocked() &&
|
2011-01-17 15:06:54 +01:00
|
|
|
pSect->ToMaximize( sal_False ) && pSect->Growable() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
pSect->InvalidateSize();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2006-08-14 15:26:44 +00:00
|
|
|
const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPageFrm *pPage = pBoss->FindPageFrm();
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( bBrowseMode || !pPage->IsFtnPage() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( pBoss->GetMaxFtnHeight() != LONG_MAX )
|
|
|
|
{
|
2001-08-29 09:47:32 +00:00
|
|
|
nDist = Min( nDist, pBoss->GetMaxFtnHeight()
|
2001-10-19 09:25:19 +00:00
|
|
|
- (Frm().*fnRect->fnGetHeight)() );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nDist <= 0 )
|
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
//Der FtnBoss will bezueglich des MaxWerts auch noch mitreden.
|
|
|
|
if( !IsInSct() )
|
|
|
|
{
|
|
|
|
const SwTwips nMax = pBoss->GetVarSpace();
|
|
|
|
if ( nDist > nMax )
|
|
|
|
nDist = nMax;
|
|
|
|
if ( nDist <= 0 )
|
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
}
|
2001-10-19 09:25:19 +00:00
|
|
|
else if( nDist > (GetPrev()->Frm().*fnRect->fnGetHeight)() )
|
2001-10-08 13:10:07 +00:00
|
|
|
//aber mehr als der Body kann koennen und wollen wir nun auch wieder
|
|
|
|
//nicht herausruecken.
|
2001-10-19 09:25:19 +00:00
|
|
|
nDist = (GetPrev()->Frm().*fnRect->fnGetHeight)();
|
2001-10-08 13:10:07 +00:00
|
|
|
|
|
|
|
long nAvail = 0;
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( bBrowseMode )
|
2001-10-08 13:10:07 +00:00
|
|
|
{
|
2001-10-19 09:25:19 +00:00
|
|
|
nAvail = GetUpper()->Prt().Height();
|
2001-10-08 13:10:07 +00:00
|
|
|
const SwFrm *pAvail = GetUpper()->Lower();
|
|
|
|
do
|
2001-10-19 09:25:19 +00:00
|
|
|
{ nAvail -= pAvail->Frm().Height();
|
2001-10-08 13:10:07 +00:00
|
|
|
pAvail = pAvail->GetNext();
|
|
|
|
} while ( pAvail );
|
|
|
|
if ( nAvail > nDist )
|
|
|
|
nAvail = nDist;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bTst )
|
|
|
|
{
|
2001-10-19 09:25:19 +00:00
|
|
|
(Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nDist );
|
2009-03-04 16:19:59 +00:00
|
|
|
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
|
|
|
|
if( IsVertical() && !IsVertLR() && !IsReverse() )
|
2001-10-08 13:10:07 +00:00
|
|
|
Frm().Pos().X() -= nDist;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
long nGrow = nDist - nAvail,
|
|
|
|
nReal = 0;
|
|
|
|
if ( nGrow > 0 )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt8 nAdjust = pBoss->NeighbourhoodAdjustment( this );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( NA_ONLY_ADJUST == nAdjust )
|
|
|
|
nReal = AdjustNeighbourhood( nGrow, bTst );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( NA_GROW_ADJUST == nAdjust )
|
|
|
|
{
|
|
|
|
SwFrm* pFtn = Lower();
|
|
|
|
if( pFtn )
|
|
|
|
{
|
|
|
|
while( pFtn->GetNext() )
|
|
|
|
pFtn = pFtn->GetNext();
|
|
|
|
if( ((SwFtnFrm*)pFtn)->GetAttr()->GetFtn().IsEndNote() )
|
|
|
|
{
|
|
|
|
nReal = AdjustNeighbourhood( nGrow, bTst );
|
|
|
|
nAdjust = NA_GROW_SHRINK; // no more AdjustNeighbourhood
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-10-19 09:25:19 +00:00
|
|
|
nReal += pBoss->Grow( nGrow - nReal, bTst );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( ( NA_GROW_ADJUST == nAdjust || NA_ADJUST_GROW == nAdjust )
|
|
|
|
&& nReal < nGrow )
|
|
|
|
nReal += AdjustNeighbourhood( nGrow - nReal, bTst );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nReal += nAvail;
|
|
|
|
|
|
|
|
if ( !bTst )
|
|
|
|
{
|
|
|
|
if ( nReal != nDist )
|
2001-08-29 09:47:32 +00:00
|
|
|
{
|
|
|
|
nDist -= nReal;
|
2000-09-18 23:08:29 +00:00
|
|
|
//Den masslosen Wunsch koennen wir leider nur in Grenzen erfuellen.
|
2001-10-19 09:25:19 +00:00
|
|
|
Frm().SSize().Height() -= nDist;
|
2009-03-04 16:19:59 +00:00
|
|
|
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
|
|
|
|
if( IsVertical() && !IsVertLR() && !IsReverse() )
|
2001-08-29 09:47:32 +00:00
|
|
|
Frm().Pos().X() += nDist;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Nachfolger braucht nicht invalidiert werden, denn wir wachsen
|
|
|
|
//immer nach oben.
|
|
|
|
if( nReal )
|
|
|
|
{
|
|
|
|
_InvalidateSize();
|
|
|
|
_InvalidatePos();
|
|
|
|
InvalidatePage( pPage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nReal;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, sal_Bool bTst, sal_Bool bInfo )
|
2001-10-19 09:25:19 +00:00
|
|
|
{
|
|
|
|
SwPageFrm *pPage = FindPageFrm();
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( pPage &&
|
|
|
|
( !pPage->IsFtnPage() ||
|
|
|
|
GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) )
|
2001-10-19 09:25:19 +00:00
|
|
|
{
|
|
|
|
SwTwips nRet = SwLayoutFrm::ShrinkFrm( nDiff, bTst, bInfo );
|
2001-11-22 08:36:37 +00:00
|
|
|
if( IsInSct() && !bTst )
|
|
|
|
FindSctFrm()->InvalidateNextPos();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !bTst && nRet )
|
|
|
|
{
|
|
|
|
_InvalidatePos();
|
|
|
|
InvalidatePage( pPage );
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnFrm::SwFtnFrm()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
|
|
|
|
SwLayoutFrm( pFmt ),
|
|
|
|
pFollow( 0 ),
|
|
|
|
pMaster( 0 ),
|
|
|
|
pRef( pCnt ),
|
|
|
|
pAttr( pAt ),
|
2011-01-17 15:06:54 +01:00
|
|
|
bBackMoveLocked( sal_False ),
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-08-11 #i49383#
|
|
|
|
mbUnlockPosOfLowerObjs( true )
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2001-08-23 13:41:20 +00:00
|
|
|
nType = FRMC_FTN;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnFrm::InvalidateNxtFtnCnts()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnFrm::InvalidateNxtFtnCnts( SwPageFrm *pPage )
|
|
|
|
{
|
|
|
|
if ( GetNext() )
|
|
|
|
{
|
|
|
|
SwFrm *pCnt = ((SwLayoutFrm*)GetNext())->ContainsAny();
|
|
|
|
if( pCnt )
|
|
|
|
{
|
|
|
|
pCnt->InvalidatePage( pPage );
|
|
|
|
pCnt->_InvalidatePrt();
|
|
|
|
do
|
|
|
|
{ pCnt->_InvalidatePos();
|
|
|
|
if( pCnt->IsSctFrm() )
|
|
|
|
{
|
|
|
|
SwFrm* pTmp = ((SwSectionFrm*)pCnt)->ContainsAny();
|
|
|
|
if( pTmp )
|
|
|
|
pTmp->_InvalidatePos();
|
|
|
|
}
|
|
|
|
pCnt->GetUpper()->_InvalidateSize();
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
} while ( pCnt && GetUpper()->IsAnLower( pCnt ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTwips SwFtnFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|
2001-10-19 09:25:19 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
static sal_uInt16 nNum = USHRT_MAX;
|
2001-10-19 09:25:19 +00:00
|
|
|
SwTxtFtn* pTxtFtn = GetAttr();
|
|
|
|
if ( pTxtFtn->GetFtn().GetNumber() == nNum )
|
|
|
|
{
|
|
|
|
int bla = 5;
|
2007-09-27 08:03:19 +00:00
|
|
|
(void)bla;
|
|
|
|
|
2001-10-19 09:25:19 +00:00
|
|
|
}
|
|
|
|
return SwLayoutFrm::GrowFrm( nDist, bTst, bInfo );
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
|
2001-10-19 09:25:19 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
static sal_uInt16 nNum = USHRT_MAX;
|
2001-10-19 09:25:19 +00:00
|
|
|
if( nNum != USHRT_MAX )
|
|
|
|
{
|
|
|
|
SwTxtFtn* pTxtFtn = GetAttr();
|
|
|
|
if( &pTxtFtn->GetAttr() && pTxtFtn->GetFtn().GetNumber() == nNum )
|
|
|
|
{
|
|
|
|
int bla = 5;
|
2007-09-27 08:03:19 +00:00
|
|
|
(void)bla;
|
2001-10-19 09:25:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return SwLayoutFrm::ShrinkFrm( nDist, bTst, bInfo );
|
|
|
|
}
|
|
|
|
#endif
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnFrm::Cut()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnFrm::Cut()
|
|
|
|
{
|
|
|
|
if ( GetNext() )
|
|
|
|
GetNext()->InvalidatePos();
|
|
|
|
else if ( GetPrev() )
|
|
|
|
GetPrev()->SetRetouche();
|
|
|
|
|
|
|
|
//Erst removen, dann Upper Shrinken.
|
|
|
|
SwLayoutFrm *pUp = GetUpper();
|
|
|
|
|
|
|
|
//Verkettung korrigieren.
|
|
|
|
SwFtnFrm *pFtn = (SwFtnFrm*)this;
|
|
|
|
if ( pFtn->GetFollow() )
|
|
|
|
pFtn->GetFollow()->SetMaster( pFtn->GetMaster() );
|
|
|
|
if ( pFtn->GetMaster() )
|
|
|
|
pFtn->GetMaster()->SetFollow( pFtn->GetFollow() );
|
|
|
|
pFtn->SetFollow( 0 );
|
|
|
|
pFtn->SetMaster( 0 );
|
|
|
|
|
|
|
|
// Alle Verbindungen kappen.
|
|
|
|
Remove();
|
|
|
|
|
|
|
|
if ( pUp )
|
|
|
|
{
|
|
|
|
//Die letzte Fussnote nimmt ihren Container mit.
|
|
|
|
if ( !pUp->Lower() )
|
|
|
|
{
|
|
|
|
SwPageFrm *pPage = pUp->FindPageFrm();
|
|
|
|
if ( pPage )
|
|
|
|
{
|
|
|
|
SwLayoutFrm *pBody = pPage->FindBodyCont();
|
|
|
|
if ( !pBody->ContainsCntnt() )
|
|
|
|
pPage->FindRootFrm()->SetSuperfluous();
|
|
|
|
}
|
|
|
|
SwSectionFrm* pSect = pUp->FindSctFrm();
|
|
|
|
pUp->Cut();
|
|
|
|
delete pUp;
|
|
|
|
// Wenn der letzte Fussnotencontainer aus einem spaltigen Bereich verschwindet,
|
|
|
|
// so kann dieser, falls er keinen Follow besitzt, zusammenschrumpfen.
|
2011-01-17 15:06:54 +01:00
|
|
|
if( pSect && !pSect->ToMaximize( sal_False ) && !pSect->IsColLocked() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pSect->_InvalidateSize();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ if ( Frm().Height() )
|
2007-02-28 14:48:08 +00:00
|
|
|
pUp->Shrink( Frm().Height() );
|
2000-09-18 23:08:29 +00:00
|
|
|
pUp->SetCompletePaint();
|
|
|
|
pUp->InvalidatePage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnFrm::Paste()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
|
|
|
|
OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
|
|
|
|
OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
|
|
|
|
OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
|
|
|
|
OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Bin noch irgendwo angemeldet." );
|
|
|
|
|
|
|
|
//In den Baum einhaengen.
|
|
|
|
InsertBefore( (SwLayoutFrm*)pParent, pSibling );
|
|
|
|
|
2001-10-08 13:10:07 +00:00
|
|
|
SWRECTFN( this )
|
|
|
|
if( (Frm().*fnRect->fnGetWidth)()!=(pParent->Prt().*fnRect->fnGetWidth)() )
|
2000-09-18 23:08:29 +00:00
|
|
|
_InvalidateSize();
|
|
|
|
_InvalidatePos();
|
|
|
|
SwPageFrm *pPage = FindPageFrm();
|
|
|
|
InvalidatePage( pPage );
|
|
|
|
if ( GetNext() )
|
|
|
|
GetNext()->_InvalidatePos();
|
2001-10-08 13:10:07 +00:00
|
|
|
if( (Frm().*fnRect->fnGetHeight)() )
|
2001-10-19 09:25:19 +00:00
|
|
|
pParent->Grow( (Frm().*fnRect->fnGetHeight)() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Wenn mein Vorgaenger mein Master ist und/oder wenn mein Nachfolger mein
|
|
|
|
//Follow ist so kann ich deren Inhalt uebernehmen und sie vernichten.
|
|
|
|
if ( GetPrev() && GetPrev() == GetMaster() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetPrev()->GetLower() ),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Fussnote ohne Inhalt?" );
|
|
|
|
(SwFlowFrm::CastFlowFrm( GetPrev()->GetLower()))->
|
|
|
|
MoveSubTree( this, GetLower() );
|
|
|
|
SwFrm *pDel = GetPrev();
|
|
|
|
pDel->Cut();
|
|
|
|
delete pDel;
|
|
|
|
}
|
|
|
|
if ( GetNext() && GetNext() == GetFollow() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetNext()->GetLower() ),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Fussnote ohne Inhalt?" );
|
|
|
|
(SwFlowFrm::CastFlowFrm( GetNext()->GetLower()))->MoveSubTree( this );
|
|
|
|
SwFrm *pDel = GetNext();
|
|
|
|
pDel->Cut();
|
|
|
|
delete pDel;
|
|
|
|
}
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
SwDoc *pDoc = GetFmt()->GetDoc();
|
|
|
|
if ( GetPrev() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetPrev())->GetAttr() ) <=
|
2000-09-18 23:08:29 +00:00
|
|
|
lcl_FindFtnPos( pDoc, GetAttr() ), "Prev ist not FtnPrev" );
|
|
|
|
}
|
|
|
|
if ( GetNext() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( lcl_FindFtnPos( pDoc, GetAttr() ) <=
|
2000-09-18 23:08:29 +00:00
|
|
|
lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetNext())->GetAttr() ),
|
|
|
|
"Next is not FtnNext" );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
InvalidateNxtFtnCnts( pPage );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFrm::GetNextFtnLeaf()
|
|
|
|
|*
|
|
|
|
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|
|
|
|
|* Frame gemoved werden kann.
|
2011-01-17 15:06:54 +01:00
|
|
|
|* Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
|
2000-09-18 23:08:29 +00:00
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
|
|
|
|
{
|
|
|
|
SwFtnBossFrm *pOldBoss = FindFtnBossFrm();
|
|
|
|
SwPageFrm* pOldPage = pOldBoss->FindPageFrm();
|
|
|
|
SwPageFrm* pPage;
|
|
|
|
SwFtnBossFrm *pBoss = pOldBoss->IsColumnFrm() ?
|
|
|
|
(SwFtnBossFrm*)pOldBoss->GetNext() : 0; // naechste Spalte, wenn vorhanden
|
|
|
|
if( pBoss )
|
|
|
|
pPage = NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( pOldBoss->GetUpper()->IsSctFrm() )
|
|
|
|
{ // Das kann nur in einem spaltigen Bereich sein
|
|
|
|
SwLayoutFrm* pNxt = pOldBoss->GetNextSctLeaf( eMakePage );
|
|
|
|
if( pNxt )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pNxt->IsColBodyFrm(), "GetNextFtnLeaf: Funny Leaf" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pBoss = (SwFtnBossFrm*)pNxt->GetUpper();
|
|
|
|
pPage = pBoss->FindPageFrm();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// naechste Seite
|
|
|
|
pPage = (SwPageFrm*)pOldPage->GetNext();
|
|
|
|
// Leerseiten ueberspringen
|
|
|
|
if( pPage && pPage->IsEmptyPage() )
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
pBoss = pPage;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Was haben wir jetzt?
|
|
|
|
// pBoss != NULL, pPage==NULL => pBoss ist die auf der gleichen Seite folgende Spalte
|
|
|
|
// pBoss != NULL, pPage!=NULL => pBoss und pPage sind die folgende Seite (Empty uebersprungen)
|
|
|
|
// pBoss == NULL => pPage == NULL, es gibt keine folgende Seite
|
|
|
|
|
|
|
|
//Wenn die Fussnote bereits einen Follow hat brauchen wir nicht zu suchen.
|
|
|
|
//Wenn allerdings zwischen Ftn und Follow unerwuenschte Leerseiten/spalten
|
|
|
|
//herumlungern, so legen wir auf der naechstbesten Seite/Spalte einen weiteren
|
|
|
|
//Follow an, der Rest wird sich schon finden.
|
|
|
|
SwFtnFrm *pFtn = FindFtnFrm();
|
|
|
|
if ( pFtn && pFtn->GetFollow() )
|
|
|
|
{
|
|
|
|
SwFtnBossFrm* pTmpBoss = pFtn->GetFollow()->FindFtnBossFrm();
|
|
|
|
// Folgende Faelle werden hier erkannt und akzeptiert
|
|
|
|
// 1. Die FtnBosse sind benachbarte Seiten oder benachbarte Spalten
|
|
|
|
// 2. Der neue ist die erste Spalte der benachbarten Seite
|
|
|
|
// 3. Der neue ist die erste Spalte in einem Bereich in der naechsten Spalte/Seite
|
|
|
|
while( pTmpBoss != pBoss && pTmpBoss && !pTmpBoss->GetPrev() )
|
|
|
|
pTmpBoss = pTmpBoss->GetUpper()->FindFtnBossFrm();
|
|
|
|
if( pTmpBoss == pBoss )
|
|
|
|
return pFtn->GetFollow();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wenn wir keinen pBoss gefunden haben oder es sich um eine "falsche" Seite handelt,
|
|
|
|
// muss eine neue Seite her
|
|
|
|
if ( !pBoss || ( pPage && pPage->IsEndNotePage() && !pOldPage->IsEndNotePage() ) )
|
|
|
|
{
|
|
|
|
if ( eMakePage == MAKEPAGE_APPEND || eMakePage == MAKEPAGE_INSERT )
|
|
|
|
{
|
|
|
|
pBoss = InsertPage( pOldPage, pOldPage->IsFtnPage() );
|
|
|
|
((SwPageFrm*)pBoss)->SetEndNotePage( pOldPage->IsEndNotePage() );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if( pBoss->IsPageFrm() )
|
|
|
|
{ // Wenn wir auf einer spaltigen Seite gelandet sind,
|
|
|
|
// gehen wir in die erste Spalte
|
|
|
|
SwLayoutFrm* pLay = pBoss->FindBodyCont();
|
|
|
|
if( pLay && pLay->Lower() && pLay->Lower()->IsColumnFrm() )
|
|
|
|
pBoss = (SwFtnBossFrm*)pLay->Lower();
|
|
|
|
}
|
|
|
|
//Seite/Spalte gefunden, da schummeln wir uns doch gleich mal 'rein
|
|
|
|
SwFtnContFrm *pCont = pBoss->FindFtnCont();
|
|
|
|
if ( !pCont && pBoss->GetMaxFtnHeight() &&
|
|
|
|
( eMakePage == MAKEPAGE_APPEND || eMakePage == MAKEPAGE_INSERT ) )
|
|
|
|
pCont = pBoss->MakeFtnCont();
|
|
|
|
return pCont;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFrm::GetPrevFtnLeaf()
|
|
|
|
|*
|
|
|
|
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|
|
|
|
|* Frame gemoved werden kann.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
|
|
|
|
{
|
|
|
|
//Der Vorgaenger fuer eine Fussnote ist falls moeglich der Master
|
|
|
|
//in der Fussnoteneigenen Verkettung.
|
|
|
|
SwLayoutFrm *pRet = 0;
|
|
|
|
SwFtnFrm *pFtn = FindFtnFrm();
|
|
|
|
pRet = pFtn->GetMaster();
|
|
|
|
|
|
|
|
SwFtnBossFrm* pOldBoss = FindFtnBossFrm();
|
|
|
|
SwPageFrm *pOldPage = pOldBoss->FindPageFrm();
|
|
|
|
|
|
|
|
if ( !pOldBoss->GetPrev() && !pOldPage->GetPrev() )
|
|
|
|
return pRet; // es gibt weder eine Spalte noch eine Seite vor uns
|
|
|
|
|
|
|
|
if ( !pRet )
|
|
|
|
{
|
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
|
|
|
bool bEndn = pFtn->GetAttr()->GetFtn().IsEndNote();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFrm* pTmpRef = NULL;
|
|
|
|
if( bEndn && pFtn->IsInSct() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pSect = pFtn->FindSctFrm();
|
|
|
|
if( pSect->IsEndnAtEnd() )
|
|
|
|
pTmpRef = pSect->FindLastCntnt( FINDMODE_LASTCNT );
|
|
|
|
}
|
|
|
|
if( !pTmpRef )
|
|
|
|
pTmpRef = pFtn->GetRef();
|
|
|
|
SwFtnBossFrm* pStop = pTmpRef->FindFtnBossFrm( !bEndn );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nNum = pStop->GetPhyPageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Wenn die Fussnoten am Dokumentende angezeigt werden, so verlassen wir
|
|
|
|
//die Entsprechenden Seiten nicht.
|
|
|
|
//Selbiges gilt analog fuer die Endnotenseiten.
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bEndNote = pOldPage->IsEndNotePage();
|
|
|
|
const sal_Bool bFtnEndDoc = pOldPage->IsFtnPage();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnBossFrm* pNxtBoss = pOldBoss;
|
|
|
|
SwSectionFrm *pSect = pNxtBoss->GetUpper()->IsSctFrm() ?
|
|
|
|
(SwSectionFrm*)pNxtBoss->GetUpper() : 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if( pNxtBoss->IsColumnFrm() && pNxtBoss->GetPrev() )
|
|
|
|
pNxtBoss = (SwFtnBossFrm*)pNxtBoss->GetPrev(); // eine Spalte zurueck
|
|
|
|
else // oder eine Seite zurueck
|
|
|
|
{
|
2007-09-27 08:03:19 +00:00
|
|
|
SwLayoutFrm* pBody = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pSect )
|
|
|
|
{
|
|
|
|
if( pSect->IsFtnLock() )
|
|
|
|
{
|
|
|
|
if( pNxtBoss == pOldBoss )
|
|
|
|
return 0;
|
|
|
|
pStop = pNxtBoss;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-13 10:17:18 +00:00
|
|
|
pSect = (SwSectionFrm*)pSect->FindMaster();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pSect || !pSect->Lower() )
|
|
|
|
return 0;
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pSect->Lower()->IsColumnFrm(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"GetPrevFtnLeaf: Where's the column?" );
|
|
|
|
pNxtBoss = (SwFtnBossFrm*)pSect->Lower();
|
|
|
|
pBody = pSect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwPageFrm* pPage = (SwPageFrm*)pNxtBoss->FindPageFrm()->GetPrev();
|
|
|
|
if( !pPage || pPage->GetPhyPageNum() < nNum ||
|
|
|
|
bEndNote != pPage->IsEndNotePage() || bFtnEndDoc != pPage->IsFtnPage() )
|
|
|
|
return NULL; // Keine in Frage kommende Seite mehr gefunden
|
|
|
|
pNxtBoss = pPage;
|
|
|
|
pBody = pPage->FindBodyCont();
|
|
|
|
}
|
|
|
|
// Die vorherige Seite haben wir nun, ggf. sollten wir in die letzte Spalte
|
|
|
|
// der Seite wechseln
|
|
|
|
if( pBody )
|
|
|
|
{
|
|
|
|
if ( pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
|
|
|
{
|
2006-03-09 13:07:53 +00:00
|
|
|
pNxtBoss = static_cast<SwFtnBossFrm*>(pBody->GetLastLower());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SwFtnContFrm *pCont = pNxtBoss->FindFtnCont();
|
|
|
|
if ( pCont )
|
|
|
|
{
|
|
|
|
pRet = pCont;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( pStop == pNxtBoss )
|
|
|
|
{ //Die Seite/Spalte auf der sich auch die Referenz tummelt, ist erreicht.
|
|
|
|
//Wir koennen jetzt probehalber mal einen Container erzeugen und
|
|
|
|
//uns hineinpasten.
|
|
|
|
if ( eMakeFtn == MAKEPAGE_FTN && pNxtBoss->GetMaxFtnHeight() )
|
|
|
|
pRet = pNxtBoss->MakeFtnCont();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} while( !pRet );
|
|
|
|
}
|
|
|
|
if ( pRet )
|
|
|
|
{
|
|
|
|
const SwFtnBossFrm* pNewBoss = pRet->FindFtnBossFrm();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bJump = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pOldBoss->IsColumnFrm() && pOldBoss->GetPrev() ) // es gibt eine vorherige Spalte
|
|
|
|
bJump = pOldBoss->GetPrev() != (SwFrm*)pNewBoss; // sind wir darin gelandet?
|
|
|
|
else if( pNewBoss->IsColumnFrm() && pNewBoss->GetNext() )
|
2011-01-17 15:06:54 +01:00
|
|
|
bJump = sal_True; // es gibt hinter dem neuen Boss noch eine Spalte, die aber nicht
|
2000-09-18 23:08:29 +00:00
|
|
|
// der alte Boss sein kann, das haben wir ja bereits geprueft.
|
|
|
|
else // hier landen wir nur, wenn neuer und alter Boss entweder Seiten oder letzte (neu)
|
|
|
|
{ // bzw. erste (alt) Spalten einer Seite sind. In diesem Fall muss noch geprueft
|
|
|
|
// werden, ob Seiten ueberspringen wurden.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nDiff = pOldPage->GetPhyPageNum() - pRet->FindPageFrm()->GetPhyPageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nDiff > 2 ||
|
|
|
|
(nDiff > 1 && !((SwPageFrm*)pOldPage->GetPrev())->IsEmptyPage()) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bJump = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( bJump )
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFlowFrm::SetMoveBwdJump( sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
return pRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFrm::IsFtnAllowed()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwFrm::IsFtnAllowed() const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !IsInDocBody() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( IsInTab() )
|
|
|
|
{
|
|
|
|
//Keine Ftns in wiederholten Headlines.
|
|
|
|
const SwTabFrm *pTab = ((SwFrm*)this)->ImplFindTabFrm();
|
2004-05-03 12:46:57 +00:00
|
|
|
if ( pTab->IsFollow() )
|
|
|
|
return !pTab->IsInHeadline( *this );
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwRootFrm::UpdateFtnNums()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwRootFrm::UpdateFtnNums()
|
|
|
|
{
|
|
|
|
//Seitenweise Numerierung nur wenn es am Dokument so eingestellt ist.
|
|
|
|
if ( GetFmt()->GetDoc()->GetFtnInfo().eNum == FTNNUM_PAGE )
|
|
|
|
{
|
|
|
|
SwPageFrm *pPage = (SwPageFrm*)Lower();
|
|
|
|
while ( pPage && !pPage->IsFtnPage() )
|
|
|
|
{
|
|
|
|
pPage->UpdateFtnNum();
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* RemoveFtns() Entfernen aller Fussnoten (nicht etwa die Referenzen)
|
|
|
|
|* und Entfernen aller Fussnotenseiten.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, sal_Bool bPageOnly, sal_Bool bEndNotes )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
SwFtnContFrm *pCont = pBoss->FindFtnCont();
|
|
|
|
if ( pCont )
|
|
|
|
{
|
|
|
|
SwFtnFrm *pFtn = (SwFtnFrm*)pCont->Lower();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pFtn, "FtnCont ohne Ftn." );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bPageOnly )
|
|
|
|
while ( pFtn->GetMaster() )
|
|
|
|
pFtn = pFtn->GetMaster();
|
|
|
|
do
|
|
|
|
{
|
|
|
|
SwFtnFrm *pNxt = (SwFtnFrm*)pFtn->GetNext();
|
|
|
|
if ( !pFtn->GetAttr()->GetFtn().IsEndNote() ||
|
|
|
|
bEndNotes )
|
|
|
|
{
|
|
|
|
pFtn->GetRef()->Prepare( PREP_FTN, (void*)pFtn->GetAttr() );
|
|
|
|
if ( bPageOnly && !pNxt )
|
|
|
|
pNxt = pFtn->GetFollow();
|
|
|
|
pFtn->Cut();
|
|
|
|
delete pFtn;
|
|
|
|
}
|
|
|
|
pFtn = pNxt;
|
|
|
|
|
|
|
|
} while ( pFtn );
|
|
|
|
}
|
2001-04-26 11:12:54 +00:00
|
|
|
if( !pBoss->IsInSct() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
// A sectionframe with the Ftn/EndnAtEnd-flags may contain
|
|
|
|
// foot/endnotes. If the last lower frame of the bodyframe is
|
|
|
|
// a multicolumned sectionframe, it may contain footnotes, too.
|
|
|
|
SwLayoutFrm* pBody = pBoss->FindBodyCont();
|
|
|
|
if( pBody && pBody->Lower() )
|
|
|
|
{
|
|
|
|
SwFrm* pLow = pBody->Lower();
|
|
|
|
while( pLow->GetNext() )
|
|
|
|
{
|
|
|
|
if( pLow->IsSctFrm() && ( !pLow->GetNext() ||
|
|
|
|
((SwSectionFrm*)pLow)->IsAnyNoteAtEnd() ) &&
|
|
|
|
((SwSectionFrm*)pLow)->Lower() &&
|
|
|
|
((SwSectionFrm*)pLow)->Lower()->IsColumnFrm() )
|
|
|
|
lcl_RemoveFtns( (SwColumnFrm*)((SwSectionFrm*)pLow)->Lower(),
|
|
|
|
bPageOnly, bEndNotes );
|
|
|
|
pLow = pLow->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// noch 'ne Spalte?
|
|
|
|
pBoss = pBoss->IsColumnFrm() ? (SwColumnFrm*)pBoss->GetNext() : NULL;
|
|
|
|
} while( pBoss );
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwRootFrm::RemoveFtns( SwPageFrm *pPage, sal_Bool bPageOnly, sal_Bool bEndNotes )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !pPage )
|
|
|
|
pPage = (SwPageFrm*)Lower();
|
|
|
|
|
|
|
|
do
|
|
|
|
{ // Bei spaltigen Seiten muessen wir in allen Spalten aufraeumen
|
|
|
|
SwFtnBossFrm* pBoss;
|
|
|
|
SwLayoutFrm* pBody = pPage->FindBodyCont();
|
|
|
|
if( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
|
|
|
pBoss = (SwFtnBossFrm*)pBody->Lower(); // die erste Spalte
|
|
|
|
else
|
|
|
|
pBoss = pPage; // keine Spalten
|
|
|
|
lcl_RemoveFtns( pBoss, bPageOnly, bEndNotes );
|
|
|
|
if ( !bPageOnly )
|
|
|
|
{
|
|
|
|
if ( pPage->IsFtnPage() &&
|
|
|
|
(!pPage->IsEndNotePage() || bEndNotes) )
|
|
|
|
{
|
|
|
|
SwFrm *pDel = pPage;
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
pDel->Cut();
|
|
|
|
delete pDel;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
|
|
|
|
} while ( pPage );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SetFtnPageDescs() Seitenvorlagen der Fussnotenseiten aendern
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwRootFrm::CheckFtnPageDescs( sal_Bool bEndNote )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwPageFrm *pPage = (SwPageFrm*)Lower();
|
|
|
|
while ( pPage && !pPage->IsFtnPage() )
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
while ( pPage && pPage->IsEndNotePage() != bEndNote )
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
|
|
|
if ( pPage )
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFrm::CheckPageDescs( pPage, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::MakeFtnCont()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
|
|
|
|
{
|
|
|
|
//Einfuegen eines Fussnotencontainers. Der Fussnotencontainer sitzt
|
|
|
|
//immer direkt hinter dem Bodytext.
|
|
|
|
//Sein FrmFmt ist immer das DefaultFrmFmt.
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( FindFtnCont() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !this, "Fussnotencontainer bereits vorhanden." );
|
2000-09-18 23:08:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt());
|
|
|
|
SwLayoutFrm *pLay = FindBodyCont();
|
|
|
|
pNew->Paste( this, pLay->GetNext() );
|
|
|
|
return pNew;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::FindFtnCont()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
|
|
|
|
{
|
|
|
|
SwFrm *pFrm = Lower();
|
|
|
|
while( pFrm && !pFrm->IsFtnContFrm() )
|
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pFrm )
|
|
|
|
{
|
|
|
|
SwFrm *pFtn = pFrm->GetLower();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pFtn, "Cont ohne Fussnote." );
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pFtn )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pFtn->IsFtnFrm(), "Nachbar von Fussnote keine Fussnote." );
|
2000-09-18 23:08:29 +00:00
|
|
|
pFtn = pFtn->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return (SwFtnContFrm*)pFrm;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::FindNearestFtnCont() Sucht den naechst greifbaren Fussnotencontainer.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( sal_Bool bDontLeave )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwFtnContFrm *pCont = 0;
|
|
|
|
if ( GetFmt()->GetDoc()->GetFtnIdxs().Count() )
|
|
|
|
{
|
|
|
|
pCont = FindFtnCont();
|
|
|
|
if ( !pCont )
|
|
|
|
{
|
|
|
|
SwPageFrm *pPage = FindPageFrm();
|
|
|
|
SwFtnBossFrm* pBoss = this;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bEndNote = pPage->IsEndNotePage();
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bChgPage = lcl_NextFtnBoss( pBoss, pPage, bDontLeave );
|
2000-09-18 23:08:29 +00:00
|
|
|
// Haben wir noch einen Boss gefunden? Bei einem Seitenwechsel muss
|
|
|
|
// zudem noch das EndNotenFlag uebereinstimmen
|
|
|
|
if( pBoss && ( !bChgPage || pPage->IsEndNotePage() == bEndNote ) )
|
|
|
|
pCont = pBoss->FindFtnCont();
|
|
|
|
} while ( !pCont && pPage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pCont;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::FindFirstFtn()
|
|
|
|
|*
|
|
|
|
|* Beschreibung Erste Fussnote des Fussnotenbosses suchen.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
|
|
|
|
{
|
|
|
|
//Erstmal den naechsten FussnotenContainer suchen.
|
|
|
|
SwFtnContFrm *pCont = FindNearestFtnCont();
|
|
|
|
if ( !pCont )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
//Ab der ersten Fussnote im Container die erste suchen, die
|
|
|
|
//von der aktuellen Spalte (bzw. einspaltigen Seite) referenziert wird.
|
|
|
|
|
|
|
|
SwFtnFrm *pRet = (SwFtnFrm*)pCont->Lower();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nRefNum = FindPageFrm()->GetPhyPageNum();
|
|
|
|
const sal_uInt16 nRefCol = lcl_ColumnNum( this );
|
|
|
|
sal_uInt16 nPgNum, nColNum; //Seitennummer, Spaltennummer
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnBossFrm* pBoss;
|
|
|
|
SwPageFrm* pPage;
|
|
|
|
if( pRet )
|
|
|
|
{
|
|
|
|
pBoss = pRet->GetRef()->FindFtnBossFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pBoss, "FindFirstFtn: No boss found" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pBoss )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False; // ?There must be a bug, but no GPF
|
2000-09-18 23:08:29 +00:00
|
|
|
pPage = pBoss->FindPageFrm();
|
|
|
|
nPgNum = pPage->GetPhyPageNum();
|
|
|
|
if ( nPgNum == nRefNum )
|
|
|
|
{
|
|
|
|
nColNum = lcl_ColumnNum( pBoss );
|
|
|
|
if( nColNum == nRefCol )
|
|
|
|
return pRet; //hat ihn.
|
|
|
|
else if( nColNum > nRefCol )
|
|
|
|
return NULL; //mind. eine Spalte zu weit.
|
|
|
|
}
|
|
|
|
else if ( nPgNum > nRefNum )
|
|
|
|
return NULL; //mind. eine Seite zu weit.
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
// Ende, wenn Ref auf einer spaeteren Seite oder auf der gleichen Seite in einer
|
|
|
|
// spaeteren Spalte liegt
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
while ( pRet->GetFollow() )
|
|
|
|
pRet = pRet->GetFollow();
|
|
|
|
|
|
|
|
SwFtnFrm *pNxt = (SwFtnFrm*)pRet->GetNext();
|
|
|
|
if ( !pNxt )
|
|
|
|
{
|
|
|
|
pBoss = pRet->FindFtnBossFrm();
|
|
|
|
pPage = pBoss->FindPageFrm();
|
2011-01-17 15:06:54 +01:00
|
|
|
lcl_NextFtnBoss( pBoss, pPage, sal_False ); // naechster FtnBoss
|
2000-09-18 23:08:29 +00:00
|
|
|
pCont = pBoss ? pBoss->FindNearestFtnCont() : 0;
|
|
|
|
if ( pCont )
|
|
|
|
pNxt = (SwFtnFrm*)pCont->Lower();
|
|
|
|
}
|
|
|
|
if ( pNxt )
|
|
|
|
{
|
|
|
|
pRet = pNxt;
|
|
|
|
pBoss = pRet->GetRef()->FindFtnBossFrm();
|
|
|
|
pPage = pBoss->FindPageFrm();
|
|
|
|
nPgNum = pPage->GetPhyPageNum();
|
|
|
|
if ( nPgNum == nRefNum )
|
|
|
|
{
|
|
|
|
nColNum = lcl_ColumnNum( pBoss );
|
|
|
|
if( nColNum == nRefCol )
|
|
|
|
break; //hat ihn.
|
|
|
|
else if( nColNum > nRefCol )
|
|
|
|
pRet = 0; //mind. eine Spalte zu weit.
|
|
|
|
}
|
|
|
|
else if ( nPgNum > nRefNum )
|
|
|
|
pRet = 0; //mind. eine Seite zu weit.
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pRet = 0; //Gibt eben keinen.
|
|
|
|
} while( pRet );
|
|
|
|
return pRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::FindFirstFtn()
|
|
|
|
|*
|
|
|
|
|* Beschreibunt Erste Fussnote zum Cnt suchen.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
|
|
|
|
{
|
|
|
|
const SwFtnFrm *pRet = ((SwFtnBossFrm*)this)->FindFirstFtn();
|
|
|
|
if ( pRet )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nColNum = lcl_ColumnNum( this ); //Spaltennummer
|
|
|
|
const sal_uInt16 nPageNum = GetPhyPageNum();
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pRet && (pRet->GetRef() != pCnt) )
|
|
|
|
{
|
|
|
|
while ( pRet->GetFollow() )
|
|
|
|
pRet = pRet->GetFollow();
|
|
|
|
|
|
|
|
if ( pRet->GetNext() )
|
|
|
|
pRet = (const SwFtnFrm*)pRet->GetNext();
|
|
|
|
else
|
|
|
|
{ SwFtnBossFrm *pBoss = (SwFtnBossFrm*)pRet->FindFtnBossFrm();
|
|
|
|
SwPageFrm *pPage = pBoss->FindPageFrm();
|
2011-01-17 15:06:54 +01:00
|
|
|
lcl_NextFtnBoss( pBoss, pPage, sal_False ); // naechster FtnBoss
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnContFrm *pCont = pBoss ? pBoss->FindNearestFtnCont() : 0;
|
|
|
|
pRet = pCont ? (SwFtnFrm*)pCont->Lower() : 0;
|
|
|
|
}
|
|
|
|
if ( pRet )
|
|
|
|
{
|
|
|
|
const SwFtnBossFrm* pBoss = pRet->GetRef()->FindFtnBossFrm();
|
|
|
|
if( pBoss->GetPhyPageNum() != nPageNum ||
|
|
|
|
nColNum != lcl_ColumnNum( pBoss ) )
|
|
|
|
pRet = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::ResetFtn()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
|
|
|
|
{
|
|
|
|
//Vernichten der Inkarnationen von Fussnoten zum Attribut, wenn sie nicht
|
|
|
|
//zu pAssumed gehoeren.
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pCheck->GetMaster(), "Master not an Master." );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwNodeIndex aIdx( *pCheck->GetAttr()->GetStartNode(), 1 );
|
|
|
|
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
|
|
|
|
if ( !pNd )
|
|
|
|
pNd = pCheck->GetFmt()->GetDoc()->
|
2011-01-17 15:06:54 +01:00
|
|
|
GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwClientIter aIter( *pNd );
|
|
|
|
SwClient* pLast = aIter.GoStart();
|
|
|
|
while( pLast )
|
|
|
|
{
|
|
|
|
if ( pLast->ISA(SwFrm) )
|
|
|
|
{
|
|
|
|
SwFrm *pFrm = (SwFrm*)pLast;
|
|
|
|
SwFrm *pTmp = pFrm->GetUpper();
|
|
|
|
while ( pTmp && !pTmp->IsFtnFrm() )
|
|
|
|
pTmp = pTmp->GetUpper();
|
|
|
|
|
|
|
|
SwFtnFrm *pFtn = (SwFtnFrm*)pTmp;
|
|
|
|
while ( pFtn && pFtn->GetMaster() )
|
|
|
|
pFtn = pFtn->GetMaster();
|
|
|
|
if ( pFtn != pCheck )
|
|
|
|
{
|
|
|
|
while ( pFtn )
|
|
|
|
{
|
|
|
|
SwFtnFrm *pNxt = pFtn->GetFollow();
|
|
|
|
pFtn->Cut();
|
|
|
|
delete pFtn;
|
|
|
|
pFtn = pNxt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pLast = ++aIter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::InsertFtn()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
|
|
|
|
{
|
|
|
|
//Die Fussnote haben wir, sie muss jetzt nur noch irgendwo
|
|
|
|
//hin und zwar vor die Fussnote, deren Attribut vor das
|
|
|
|
//der neuen zeigt (Position wird ueber das Doc ermittelt)
|
|
|
|
//Gibt es in diesem Fussnotenboss noch keine Fussnoten, so muss eben ein
|
|
|
|
//Container erzeugt werden.
|
|
|
|
//Gibt es bereits einen Container aber noch keine Fussnote zu diesem
|
|
|
|
//Fussnotenboss, so muss die Fussnote hinter die letzte Fussnote der dichtesten
|
|
|
|
//Vorseite/spalte.
|
|
|
|
|
|
|
|
ResetFtn( pNew );
|
|
|
|
SwFtnFrm *pSibling = FindFirstFtn();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bDontLeave = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// Ok, a sibling has been found, but is the sibling in an acceptable
|
|
|
|
// environment?
|
|
|
|
if( IsInSct() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pMySect = ImplFindSctFrm();
|
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
|
|
|
bool bEndnt = pNew->GetAttr()->GetFtn().IsEndNote();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bEndnt )
|
|
|
|
{
|
|
|
|
const SwSectionFmt* pEndFmt = pMySect->GetEndSectFmt();
|
|
|
|
bDontLeave = 0 != pEndFmt;
|
|
|
|
if( pSibling )
|
|
|
|
{
|
|
|
|
if( pEndFmt )
|
|
|
|
{
|
|
|
|
if( !pSibling->IsInSct() ||
|
|
|
|
!pSibling->ImplFindSctFrm()->IsDescendantFrom( pEndFmt ) )
|
|
|
|
pSibling = NULL;
|
|
|
|
}
|
|
|
|
else if( pSibling->IsInSct() )
|
|
|
|
pSibling = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bDontLeave = pMySect->IsFtnAtEnd();
|
|
|
|
if( pSibling )
|
|
|
|
{
|
|
|
|
if( pMySect->IsFtnAtEnd() )
|
|
|
|
{
|
|
|
|
if( !pSibling->IsInSct() ||
|
|
|
|
!pMySect->IsAnFollow( pSibling->ImplFindSctFrm() ) )
|
|
|
|
pSibling = NULL;
|
|
|
|
}
|
|
|
|
else if( pSibling->IsInSct() )
|
|
|
|
pSibling = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pSibling && pSibling->FindPageFrm()->IsEndNotePage() !=
|
|
|
|
FindPageFrm()->IsEndNotePage() )
|
|
|
|
pSibling = NULL;
|
|
|
|
|
|
|
|
//Damit die Position herausgefunden werden kann.
|
|
|
|
SwDoc *pDoc = GetFmt()->GetDoc();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pNew->GetAttr() );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong nCmpPos = 0;
|
|
|
|
sal_uLong nLastPos = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnContFrm *pParent = 0;
|
|
|
|
if( pSibling )
|
|
|
|
{
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
|
|
|
|
if( nCmpPos > nStPos )
|
|
|
|
pSibling = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pSibling )
|
|
|
|
{ pParent = FindFtnCont();
|
|
|
|
if ( !pParent )
|
|
|
|
{
|
|
|
|
//Es gibt noch keinen FussnotenContainer, also machen wir einen.
|
|
|
|
//HAAAAAAAALT! So einfach ist das leider mal wieder nicht: Es kann
|
|
|
|
//sein, dass irgendeine naechste Fussnote existiert die vor der
|
|
|
|
//einzufuegenden zu stehen hat, weil z.B. eine Fussnote ueber zig
|
|
|
|
//Seiten aufgespalten ist usw.
|
|
|
|
pParent = FindNearestFtnCont( bDontLeave );
|
|
|
|
if ( pParent )
|
|
|
|
{
|
|
|
|
SwFtnFrm *pFtn = (SwFtnFrm*)pParent->Lower();
|
|
|
|
if ( pFtn )
|
|
|
|
{
|
|
|
|
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pFtn->GetAttr() );
|
|
|
|
if ( nCmpPos > nStPos )
|
|
|
|
pParent = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pParent = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !pParent )
|
|
|
|
//Jetzt kann aber ein Fussnotencontainer gebaut werden.
|
|
|
|
pParent = MakeFtnCont();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Ausgehend von der ersten Fussnote unterhalb des Parents wird die
|
|
|
|
//erste Fussnote gesucht deren Index hinter dem Index der
|
|
|
|
//einzufuegenden liegt; vor dieser kann der neue dann gepastet
|
|
|
|
//werden.
|
|
|
|
pSibling = (SwFtnFrm*)pParent->Lower();
|
|
|
|
if ( !pSibling )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !this, "Keinen Platz fuer Fussnote gefunden.");
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
|
|
|
|
|
|
|
|
SwFtnBossFrm *pNxtB = this; //Immer den letzten merken, damit wir nicht
|
|
|
|
SwFtnFrm *pLastSib = 0; //ueber das Ziel hinausschiessen.
|
|
|
|
|
|
|
|
while ( pSibling && nCmpPos <= nStPos )
|
|
|
|
{
|
|
|
|
pLastSib = pSibling; // der kommt schon mal in Frage
|
|
|
|
nLastPos = nCmpPos;
|
|
|
|
|
|
|
|
while ( pSibling->GetFollow() )
|
|
|
|
pSibling = pSibling->GetFollow();
|
|
|
|
|
|
|
|
if ( pSibling->GetNext() )
|
|
|
|
{
|
|
|
|
pSibling = (SwFtnFrm*)pSibling->GetNext();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pSibling->GetMaster() || ( ENDNOTE > nStPos &&
|
2000-09-18 23:08:29 +00:00
|
|
|
pSibling->GetAttr()->GetFtn().IsEndNote() ),
|
|
|
|
"InsertFtn: Master expected I" );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pNxtB = pSibling->FindFtnBossFrm();
|
|
|
|
SwPageFrm *pSibPage = pNxtB->FindPageFrm();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bEndNote = pSibPage->IsEndNotePage();
|
|
|
|
sal_Bool bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
|
2000-09-18 23:08:29 +00:00
|
|
|
// Bei Seitenwechsel muss das EndNoteFlag ueberprueft werden.
|
|
|
|
SwFtnContFrm *pCont = pNxtB && ( !bChgPage ||
|
|
|
|
pSibPage->IsEndNotePage() == bEndNote )
|
|
|
|
? pNxtB->FindNearestFtnCont( bDontLeave ) : 0;
|
|
|
|
if( pCont )
|
|
|
|
pSibling = (SwFtnFrm*)pCont->Lower();
|
|
|
|
else // kein weiterer FtnContainer, dann werden wir uns wohl hinter
|
|
|
|
break; // pSibling haengen
|
|
|
|
}
|
|
|
|
if ( pSibling )
|
|
|
|
{
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( nCmpPos > nLastPos, "InsertFtn: Order of FtnFrm's buggy" );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// pLastSib ist jetzt die letzte Fussnote vor uns,
|
|
|
|
// pSibling leer oder die erste nach uns.
|
|
|
|
if ( pSibling && pLastSib && (pSibling != pLastSib) )
|
|
|
|
{ //Sind wir vielleicht bereits ueber das Ziel hinausgeschossen?
|
|
|
|
if ( nCmpPos > nStPos )
|
|
|
|
pSibling = pLastSib;
|
|
|
|
}
|
|
|
|
else if ( !pSibling )
|
|
|
|
{ //Eine Chance haben wir noch: wir nehmen einfach die letzte
|
|
|
|
//Fussnote im Parent. Ein Sonderfall, der z.B. beim
|
|
|
|
//zurueckfliessen von Absaetzen mit mehreren Fussnoten
|
|
|
|
//vorkommt.
|
|
|
|
//Damit wir nicht die Reihenfolge verwuerfeln muessen wir den
|
|
|
|
//Parent der letzten Fussnote, die wir an der Hand hatten benutzen.
|
|
|
|
pSibling = pLastSib;
|
|
|
|
while( pSibling->GetFollow() )
|
|
|
|
pSibling = pSibling->GetFollow();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pSibling->GetNext(), "InsertFtn: Who's that guy?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ //Die erste Fussnote der Spalte/Seite haben wir an der Hand, jetzt ausgehend
|
|
|
|
//von dieser die erste zur selben Spalte/Seite suchen deren Index hinter
|
|
|
|
//den uebergebenen zeigt, die letzte, die wir an der Hand hatten, ist
|
|
|
|
//dann der Vorgaenger.
|
|
|
|
SwFtnBossFrm* pBoss = pNew->GetRef()->FindFtnBossFrm(
|
|
|
|
!pNew->GetAttr()->GetFtn().IsEndNote() );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nRefNum = pBoss->GetPhyPageNum(); // Die Seiten- und
|
|
|
|
sal_uInt16 nRefCol = lcl_ColumnNum( pBoss ); // Spaltennummer der neuen Fussnote
|
|
|
|
sal_Bool bEnd = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnFrm *pLastSib = 0;
|
|
|
|
while ( pSibling && !bEnd && (nCmpPos <= nStPos) )
|
|
|
|
{
|
|
|
|
pLastSib = pSibling;
|
|
|
|
nLastPos = nCmpPos;
|
|
|
|
|
|
|
|
while ( pSibling->GetFollow() )
|
|
|
|
pSibling = pSibling->GetFollow();
|
|
|
|
|
|
|
|
SwFtnFrm *pFoll = (SwFtnFrm*)pSibling->GetNext();
|
|
|
|
if ( pFoll )
|
|
|
|
{
|
|
|
|
pBoss = pSibling->GetRef()->FindFtnBossFrm( !pSibling->
|
|
|
|
GetAttr()->GetFtn().IsEndNote() );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nTmpRef;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( nStPos >= ENDNOTE ||
|
|
|
|
(nTmpRef = pBoss->GetPhyPageNum()) < nRefNum ||
|
|
|
|
( nTmpRef == nRefNum && lcl_ColumnNum( pBoss ) <= nRefCol ))
|
|
|
|
pSibling = pFoll;
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFtnBossFrm* pNxtB = pSibling->FindFtnBossFrm();
|
|
|
|
SwPageFrm *pSibPage = pNxtB->FindPageFrm();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bEndNote = pSibPage->IsEndNotePage();
|
|
|
|
sal_Bool bChgPage = lcl_NextFtnBoss( pNxtB, pSibPage, bDontLeave );
|
2000-09-18 23:08:29 +00:00
|
|
|
// Bei Seitenwechsel muss das EndNoteFlag ueberprueft werden.
|
|
|
|
SwFtnContFrm *pCont = pNxtB && ( !bChgPage ||
|
|
|
|
pSibPage->IsEndNotePage() == bEndNote )
|
|
|
|
? pNxtB->FindNearestFtnCont( bDontLeave ) : 0;
|
|
|
|
if ( pCont )
|
|
|
|
pSibling = (SwFtnFrm*)pCont->Lower();
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if ( !bEnd && pSibling )
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
|
|
|
|
if ( pSibling && pLastSib && (pSibling != pLastSib) )
|
|
|
|
{ //Sind wir vielleicht bereits ueber das Ziel hinausgeschossen?
|
|
|
|
if ( (nLastPos < nCmpPos) && (nCmpPos > nStPos) )
|
|
|
|
{
|
|
|
|
pSibling = pLastSib;
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( pSibling )
|
|
|
|
{
|
|
|
|
nCmpPos = ::lcl_FindFtnPos( pDoc, pSibling->GetAttr() );
|
|
|
|
if ( nCmpPos < nStPos )
|
|
|
|
{
|
|
|
|
while ( pSibling->GetFollow() )
|
|
|
|
pSibling = pSibling->GetFollow();
|
|
|
|
pParent = (SwFtnContFrm*)pSibling->GetUpper();
|
|
|
|
pSibling = (SwFtnFrm*)pSibling->GetNext();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( pSibling->GetMaster() )
|
|
|
|
{
|
|
|
|
if( ENDNOTE > nCmpPos || nStPos >= ENDNOTE )
|
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
OSL_ENSURE( sal_False, "InsertFtn: Master expected II" );
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
pSibling = pSibling->GetMaster();
|
|
|
|
while ( pSibling->GetMaster() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pParent = (SwFtnContFrm*)pSibling->GetUpper();
|
|
|
|
}
|
|
|
|
}
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pParent, "paste in space?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pNew->Paste( pParent, pSibling );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::AppendFtn()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
|
|
|
|
{
|
|
|
|
//Wenn es die Fussnote schon gibt tun wir nix.
|
|
|
|
if ( FindFtn( pRef, pAttr ) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
//Wenn Fussnoten am Dokumentende eingestellt sind, so brauchen wir 'eh erst
|
|
|
|
//ab der entsprechenden Seite zu suchen.
|
|
|
|
//Wenn es noch keine gibt, muss eben eine erzeugt werden.
|
|
|
|
//Wenn es sich um eine Endnote handelt, muss eine Endnotenseite gesucht
|
|
|
|
//bzw. erzeugt werden.
|
|
|
|
SwDoc *pDoc = GetFmt()->GetDoc();
|
|
|
|
SwFtnBossFrm *pBoss = this;
|
|
|
|
SwPageFrm *pPage = FindPageFrm();
|
|
|
|
SwPageFrm *pMyPage = pPage;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bChgPage = sal_False;
|
|
|
|
sal_Bool bEnd = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pAttr->GetFtn().IsEndNote() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bEnd = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( GetUpper()->IsSctFrm() &&
|
|
|
|
((SwSectionFrm*)GetUpper())->IsEndnAtEnd() )
|
|
|
|
{
|
|
|
|
SwFrm* pLast =
|
|
|
|
((SwSectionFrm*)GetUpper())->FindLastCntnt( FINDMODE_ENDNOTE );
|
|
|
|
if( pLast )
|
|
|
|
{
|
|
|
|
pBoss = pLast->FindFtnBossFrm();
|
|
|
|
pPage = pBoss->FindPageFrm();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while ( pPage->GetNext() && !pPage->IsEndNotePage() )
|
|
|
|
{
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
2011-01-17 15:06:54 +01:00
|
|
|
bChgPage = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if ( !pPage->IsEndNotePage() )
|
|
|
|
{
|
|
|
|
SwPageDesc *pDesc = pDoc->GetEndNoteInfo().GetPageDesc( *pDoc );
|
2001-03-02 09:47:13 +00:00
|
|
|
pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
|
2011-01-17 15:06:54 +01:00
|
|
|
!pPage->OnRightPage(), sal_False, sal_True, 0 );
|
|
|
|
pPage->SetEndNotePage( sal_True );
|
|
|
|
bChgPage = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Wir koennen wenigstens schon mal ungefaehr die richtige Seite
|
|
|
|
//suchen. Damit stellen wir sicher das wir auch bei hunderten
|
|
|
|
//Fussnoten noch in endlicher Zeit fertig werden.
|
|
|
|
SwPageFrm *pNxt = (SwPageFrm*)pPage->GetNext();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pNxt && pNxt->IsEndNotePage() )
|
|
|
|
{
|
|
|
|
SwFtnContFrm *pCont = pNxt->FindFtnCont();
|
|
|
|
if ( pCont && pCont->Lower() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nStPos > ::lcl_FindFtnPos( pDoc,
|
|
|
|
((SwFtnFrm*)pCont->Lower())->GetAttr()))
|
|
|
|
{
|
|
|
|
pPage = pNxt;
|
|
|
|
pNxt = (SwPageFrm*)pPage->GetNext();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( FTNPOS_CHAPTER == pDoc->GetFtnInfo().ePos && ( !GetUpper()->
|
|
|
|
IsSctFrm() || !((SwSectionFrm*)GetUpper())->IsFtnAtEnd() ) )
|
|
|
|
{
|
|
|
|
while ( pPage->GetNext() && !pPage->IsFtnPage() &&
|
|
|
|
!((SwPageFrm*)pPage->GetNext())->IsEndNotePage() )
|
|
|
|
{
|
|
|
|
pPage = (SwPageFrm*)pPage->GetNext();
|
2011-01-17 15:06:54 +01:00
|
|
|
bChgPage = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( !pPage->IsFtnPage() )
|
|
|
|
{
|
|
|
|
SwPageDesc *pDesc = pDoc->GetFtnInfo().GetPageDesc( *pDoc );
|
2001-03-02 09:47:13 +00:00
|
|
|
pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
|
2011-01-17 15:06:54 +01:00
|
|
|
!pPage->OnRightPage(), sal_False, sal_True, pPage->GetNext() );
|
|
|
|
bChgPage = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Wir koennen wenigstens schon mal ungefaehr die richtige Seite
|
|
|
|
//suchen. Damit stellen wir sicher das wir auch bei hunderten
|
|
|
|
//Fussnoten noch in endlicher Zeit fertig werden.
|
|
|
|
SwPageFrm *pNxt = (SwPageFrm*)pPage->GetNext();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nStPos = ::lcl_FindFtnPos( pDoc, pAttr );
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pNxt && pNxt->IsFtnPage() && !pNxt->IsEndNotePage() )
|
|
|
|
{
|
|
|
|
SwFtnContFrm *pCont = pNxt->FindFtnCont();
|
|
|
|
if ( pCont && pCont->Lower() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCont->Lower()->IsFtnFrm(), "Keine Ftn im Container" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nStPos > ::lcl_FindFtnPos( pDoc,
|
|
|
|
((SwFtnFrm*)pCont->Lower())->GetAttr()))
|
|
|
|
{
|
|
|
|
pPage = pNxt;
|
|
|
|
pNxt = (SwPageFrm*)pPage->GetNext();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Erstmal eine Fussnote und die benoetigten CntntFrms anlegen.
|
|
|
|
if ( !pAttr->GetStartNode() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !this, "Kein Fussnoteninhalt." );
|
2000-09-18 23:08:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wenn es auf der Seite/Spalte bereits einen FtnCont gibt,
|
|
|
|
// kann in einen spaltigen Bereich keiner erzeugt werden.
|
|
|
|
if( pBoss->IsInSct() && pBoss->IsColumnFrm() && !pPage->IsFtnPage() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pSct = pBoss->FindSctFrm();
|
|
|
|
if( bEnd ? !pSct->IsEndnAtEnd() : !pSct->IsFtnAtEnd() )
|
|
|
|
{
|
|
|
|
SwFtnContFrm* pFtnCont = pSct->FindFtnBossFrm(!bEnd)->FindFtnCont();
|
|
|
|
if( pFtnCont )
|
|
|
|
{
|
|
|
|
SwFtnFrm* pTmp = (SwFtnFrm*)pFtnCont->Lower();
|
|
|
|
if( bEnd )
|
|
|
|
while( pTmp && !pTmp->GetAttr()->GetFtn().IsEndNote() )
|
|
|
|
pTmp = (SwFtnFrm*)pTmp->GetNext();
|
|
|
|
if( pTmp && *pTmp < pAttr )
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), pRef, pAttr );
|
|
|
|
{
|
|
|
|
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
|
|
|
|
::_InsertCnt( pNew, pDoc, aIdx.GetIndex() );
|
|
|
|
}
|
|
|
|
// Wenn die Seite gewechselt (oder gar neu angelegt) wurde,
|
|
|
|
// muessen wir uns dort in die erste Spalte setzen
|
|
|
|
if( bChgPage )
|
|
|
|
{
|
|
|
|
SwLayoutFrm* pBody = pPage->FindBodyCont();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pBody, "AppendFtn: NoPageBody?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
|
|
|
pBoss = (SwFtnBossFrm*)pBody->Lower();
|
|
|
|
else
|
|
|
|
pBoss = pPage; // bei nichtspaltigen Seiten auf die Seite selbst
|
|
|
|
}
|
|
|
|
pBoss->InsertFtn( pNew );
|
|
|
|
if ( pNew->GetUpper() ) //Eingesetzt oder nicht?
|
|
|
|
{
|
|
|
|
::RegistFlys( pNew->FindPageFrm(), pNew );
|
|
|
|
SwSectionFrm* pSect = FindSctFrm();
|
|
|
|
// Der Inhalt des FtnContainers in einem (spaltigen) Bereich
|
|
|
|
// braucht nur kalkuliert zu werden,
|
|
|
|
// wenn der Bereich bereits bis zur Unterkante seines Uppers geht.
|
|
|
|
if( pSect && !pSect->IsJoinLocked() && ( bEnd ? !pSect->IsEndnAtEnd() :
|
|
|
|
!pSect->IsFtnAtEnd() ) && pSect->Growable() )
|
|
|
|
pSect->InvalidateSize();
|
|
|
|
else
|
|
|
|
{
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383# - disable unlock of position of
|
|
|
|
// lower objects during format of footnote content.
|
|
|
|
const bool bOldFtnFrmLocked( pNew->IsColLocked() );
|
|
|
|
pNew->ColLock();
|
|
|
|
pNew->KeepLockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// SwLayNotify* pFtnFrmNotitfy = new SwLayNotify( pNew );
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
SwCntntFrm *pCnt = pNew->ContainsCntnt();
|
|
|
|
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
|
|
|
|
{
|
|
|
|
pCnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
|
|
|
|
{
|
|
|
|
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
|
|
|
|
*(pCnt->FindPageFrm()) ) )
|
|
|
|
{
|
|
|
|
// restart format with first content
|
|
|
|
pCnt = pNew->ContainsCntnt();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt = (SwCntntFrm*)pCnt->FindNextCnt();
|
|
|
|
}
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383#
|
|
|
|
if ( !bOldFtnFrmLocked )
|
|
|
|
{
|
|
|
|
pNew->ColUnlock();
|
|
|
|
}
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// enable lock of lower object position before format of footnote frame.
|
2005-09-28 10:12:51 +00:00
|
|
|
pNew->UnlockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
// <--
|
|
|
|
pNew->Calc();
|
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// pNew->UnlockPosOfLowerObjs();
|
|
|
|
// delete pFtnFrmNotitfy;
|
|
|
|
// <--
|
2005-09-28 10:12:51 +00:00
|
|
|
if ( !bOldFtnFrmLocked && !pNew->GetLower() &&
|
|
|
|
!pNew->IsColLocked() && !pNew->IsBackMoveLocked() )
|
|
|
|
{
|
|
|
|
pNew->Cut();
|
|
|
|
delete pNew;
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
pMyPage->UpdateFtnNum();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
delete pNew;
|
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::FindFtn()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
|
|
|
|
{
|
|
|
|
//Der einfachste und sicherste Weg geht ueber das Attribut.
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pAttr->GetStartNode(), "FtnAtr ohne StartNode." );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
|
|
|
|
SwCntntNode *pNd = aIdx.GetNode().GetCntntNode();
|
|
|
|
if ( !pNd )
|
|
|
|
pNd = pRef->GetAttrSet()->GetDoc()->
|
2011-01-17 15:06:54 +01:00
|
|
|
GetNodes().GoNextSection( &aIdx, sal_True, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( !pNd )
|
|
|
|
return 0;
|
|
|
|
SwClientIter aIter( *pNd );
|
|
|
|
SwClient *pClient;
|
|
|
|
if ( 0 != (pClient = aIter.GoStart()) )
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if ( pClient->IsA( TYPE(SwFrm) ) )
|
|
|
|
{
|
|
|
|
SwFrm *pFrm = ((SwFrm*)pClient)->GetUpper();
|
2004-06-04 07:45:17 +00:00
|
|
|
// #i28500#, #i27243# Due to the endnode collector, there are
|
|
|
|
// SwFtnFrms, which are not in the layout. Therefore the
|
|
|
|
// bInfFtn flags are not set correctly, and a cell of FindFtnFrm
|
|
|
|
// would return 0. Therefore we better call ImplFindFtnFrm().
|
|
|
|
SwFtnFrm *pFtn = pFrm->ImplFindFtnFrm();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pFtn && pFtn->GetRef() == pRef )
|
|
|
|
{
|
|
|
|
// The following condition becomes true, if the whole
|
|
|
|
// footnotecontent is a section. While no frames exist,
|
|
|
|
// the HiddenFlag of the section is set, this causes
|
|
|
|
// the GoNextSection-function leaves the footnote.
|
|
|
|
if( pFtn->GetAttr() != pAttr )
|
|
|
|
return 0;
|
|
|
|
while ( pFtn && pFtn->GetMaster() )
|
|
|
|
pFtn = pFtn->GetMaster();
|
|
|
|
return pFtn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while ( 0 != (pClient = aIter++) );
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::RemoveFtn()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bPrep )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwFtnFrm *pFtn = FindFtn( pRef, pAttr );
|
|
|
|
if( pFtn )
|
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
SwFtnFrm *pFoll = pFtn->GetFollow();
|
|
|
|
pFtn->Cut();
|
|
|
|
delete pFtn;
|
|
|
|
pFtn = pFoll;
|
|
|
|
} while ( pFtn );
|
|
|
|
if( bPrep && pRef->IsFollow() )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pRef->IsTxtFrm(), "NoTxtFrm has Footnote?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTxtFrm* pMaster = (SwTxtFrm*)pRef->FindMaster();
|
|
|
|
if( !pMaster->IsLocked() )
|
|
|
|
pMaster->Prepare( PREP_FTN_GONE );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FindPageFrm()->UpdateFtnNum();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::ChangeFtnRef()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *pAttr,
|
|
|
|
SwCntntFrm *pNew )
|
|
|
|
{
|
|
|
|
SwFtnFrm *pFtn = FindFtn( pOld, pAttr );
|
|
|
|
while ( pFtn )
|
|
|
|
{
|
|
|
|
pFtn->SetRef( pNew );
|
|
|
|
pFtn = pFtn->GetFollow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::CollectFtns()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2003-04-17 15:07:07 +00:00
|
|
|
/// OD 03.04.2003 #108446# - add parameter <_bCollectOnlyPreviousFtns> in
|
|
|
|
/// order to control, if only footnotes, which are positioned before the
|
|
|
|
/// footnote boss frame <this> have to be collected.
|
|
|
|
void SwFtnBossFrm::CollectFtns( const SwCntntFrm* _pRef,
|
|
|
|
SwFtnBossFrm* _pOld,
|
|
|
|
SvPtrarr& _rFtnArr,
|
|
|
|
const sal_Bool _bCollectOnlyPreviousFtns )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 15:07:07 +00:00
|
|
|
SwFtnFrm *pFtn = _pOld->FindFirstFtn();
|
2000-09-18 23:08:29 +00:00
|
|
|
while( !pFtn )
|
|
|
|
{
|
2003-04-17 15:07:07 +00:00
|
|
|
if( _pOld->IsColumnFrm() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ // Spalten abklappern
|
2003-04-17 15:07:07 +00:00
|
|
|
while ( !pFtn && _pOld->GetPrev() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//Wenn wir keine Fussnote gefunden haben, ist noch nicht alles zu
|
|
|
|
//spaet. Die Schleife wird beim Aufnehmen von Follow-Zeilen durch
|
|
|
|
//Tabellen benoetigt. Fuer alle anderen Faelle ist sie in der Lage
|
|
|
|
//'krumme' Verhaeltnisse zu korrigieren.
|
2003-04-17 15:07:07 +00:00
|
|
|
_pOld = (SwFtnBossFrm*)_pOld->GetPrev();
|
|
|
|
pFtn = _pOld->FindFirstFtn();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if( !pFtn )
|
|
|
|
{
|
|
|
|
// vorherige Seite
|
|
|
|
SwPageFrm* pPg;
|
2003-04-17 15:07:07 +00:00
|
|
|
for ( SwFrm* pTmp = _pOld;
|
|
|
|
0 != ( pPg = (SwPageFrm*)pTmp->FindPageFrm()->GetPrev())
|
|
|
|
&& pPg->IsEmptyPage() ;
|
|
|
|
)
|
|
|
|
{
|
2000-09-18 23:08:29 +00:00
|
|
|
pTmp = pPg;
|
2003-04-17 15:07:07 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pPg )
|
|
|
|
return;
|
|
|
|
|
|
|
|
SwLayoutFrm* pBody = pPg->FindBodyCont();
|
|
|
|
if( pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
2006-03-09 13:07:53 +00:00
|
|
|
{
|
|
|
|
// mehrspaltige Seite => letzte Spalte suchen
|
|
|
|
_pOld = static_cast<SwFtnBossFrm*>(pBody->GetLastLower());
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2003-04-17 15:07:07 +00:00
|
|
|
_pOld = pPg; // einspaltige Seite
|
|
|
|
pFtn = _pOld->FindFirstFtn();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2003-04-17 15:07:07 +00:00
|
|
|
// OD 03.04.2003 #108446# - consider new parameter <_bCollectOnlyPreviousFtns>
|
|
|
|
SwFtnBossFrm* pRefBossFrm = NULL;
|
|
|
|
if ( _bCollectOnlyPreviousFtns )
|
|
|
|
{
|
|
|
|
pRefBossFrm = this;
|
|
|
|
}
|
|
|
|
_CollectFtns( _pRef, pFtn, _rFtnArr, _bCollectOnlyPreviousFtns, pRefBossFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::_CollectFtns()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
inline void FtnInArr( SvPtrarr& rFtnArr, SwFtnFrm* pFtn )
|
|
|
|
{
|
|
|
|
if ( USHRT_MAX == rFtnArr.GetPos( (VoidPtr)pFtn ) )
|
|
|
|
rFtnArr.Insert( (VoidPtr)pFtn, rFtnArr.Count() );
|
|
|
|
}
|
|
|
|
|
2003-04-17 15:07:07 +00:00
|
|
|
/// OD 03.04.2003 #108446# - add parameters <_bCollectOnlyPreviousFtns> and
|
|
|
|
/// <_pRefFtnBossFrm> in order to control, if only footnotes, which are positioned
|
|
|
|
/// before the given reference footnote boss frame have to be collected.
|
|
|
|
/// Note: if parameter <_bCollectOnlyPreviousFtns> is true, then parameter
|
|
|
|
/// <_pRefFtnBossFrm> have to be referenced to an object.
|
|
|
|
/// Adjust parameter names.
|
|
|
|
void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
|
|
|
|
SwFtnFrm* _pFtn,
|
|
|
|
SvPtrarr& _rFtnArr,
|
|
|
|
sal_Bool _bCollectOnlyPreviousFtns,
|
|
|
|
const SwFtnBossFrm* _pRefFtnBossFrm)
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2003-04-17 15:07:07 +00:00
|
|
|
// OD 03.04.2003 #108446# - assert, that no reference footnote boss frame
|
|
|
|
// is set, in spite of the order, that only previous footnotes has to be
|
|
|
|
// collected.
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !_bCollectOnlyPreviousFtns || _pRefFtnBossFrm,
|
2003-04-17 15:07:07 +00:00
|
|
|
"<SwFtnBossFrm::_CollectFtns(..)> - No reference footnote boss frame for collecting only previous footnotes set.\nCrash will be caused!" );
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Alle Fussnoten die von pRef referenziert werden nacheinander
|
|
|
|
//einsammeln (Attribut fuer Attribut), zusammengefuegen
|
|
|
|
//(der Inhalt zu einem Attribut kann ueber mehrere Seiten verteilt sein)
|
|
|
|
//und ausschneiden.
|
|
|
|
|
|
|
|
SvPtrarr aNotFtnArr( 20, 20 ); //Zur Robustheit werden hier die nicht
|
|
|
|
//dazugehoerigen Fussnoten eingetragen.
|
|
|
|
//Wenn eine Fussnote zweimal angefasst wird
|
|
|
|
//ists vorbei! So kommt die Funktion auch
|
|
|
|
//noch mit einem kaputten Layout
|
|
|
|
//einigermassen (ohne Schleife und Absturz)
|
|
|
|
//"klar".
|
|
|
|
|
|
|
|
//Hier sollte keiner mit einer Follow-Ftn ankommen, es sei denn er hat
|
|
|
|
//ernste Absichten (:-)); spricht er kommt mit einer Ftn an die vor der
|
|
|
|
//ersten der Referenz liegt.
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !_pFtn->GetMaster() || _pFtn->GetRef() != _pRef, "FollowFtn moven?" );
|
2003-04-17 15:07:07 +00:00
|
|
|
while ( _pFtn->GetMaster() )
|
|
|
|
_pFtn = _pFtn->GetMaster();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bFound = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-04-17 15:07:07 +00:00
|
|
|
while ( _pFtn )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//Erstmal die naechste Fussnote der Spalte/Seite suchen, damit wir nicht
|
|
|
|
//nach dem Cut jeder Fussnote von vorn anfangen muessen.
|
2003-04-17 15:07:07 +00:00
|
|
|
SwFtnFrm *pNxtFtn = _pFtn;
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pNxtFtn->GetFollow() )
|
|
|
|
pNxtFtn = pNxtFtn->GetFollow();
|
|
|
|
pNxtFtn = (SwFtnFrm*)pNxtFtn->GetNext();
|
|
|
|
|
|
|
|
if ( !pNxtFtn )
|
|
|
|
{
|
2003-04-17 15:07:07 +00:00
|
|
|
SwFtnBossFrm* pBoss = _pFtn->FindFtnBossFrm();
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPageFrm* pPage = pBoss->FindPageFrm();
|
|
|
|
do
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
lcl_NextFtnBoss( pBoss, pPage, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pBoss )
|
|
|
|
{
|
|
|
|
SwLayoutFrm* pCont = pBoss->FindFtnCont();
|
|
|
|
if( pCont )
|
|
|
|
{
|
|
|
|
pNxtFtn = (SwFtnFrm*)pCont->Lower();
|
|
|
|
if( pNxtFtn )
|
|
|
|
{
|
|
|
|
while( pNxtFtn->GetMaster() )
|
|
|
|
pNxtFtn = pNxtFtn->GetMaster();
|
2003-04-17 15:07:07 +00:00
|
|
|
if( pNxtFtn == _pFtn )
|
2000-09-18 23:08:29 +00:00
|
|
|
pNxtFtn = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while( !pNxtFtn && pBoss );
|
|
|
|
}
|
|
|
|
else if( !pNxtFtn->GetAttr()->GetFtn().IsEndNote() )
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !pNxtFtn->GetMaster(), "_CollectFtn: Master exspected" );
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pNxtFtn->GetMaster() )
|
|
|
|
pNxtFtn = pNxtFtn->GetMaster();
|
|
|
|
}
|
2003-04-17 15:07:07 +00:00
|
|
|
if ( pNxtFtn == _pFtn )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
OSL_ENSURE( sal_False, "_CollectFtn: Devil's circle" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pNxtFtn = 0;
|
|
|
|
}
|
|
|
|
|
2003-04-17 15:07:07 +00:00
|
|
|
// OD 03.04.2003 #108446# - determine, if found footnote has to be collected.
|
|
|
|
sal_Bool bCollectFoundFtn = sal_False;
|
|
|
|
if ( _pFtn->GetRef() == _pRef && !_pFtn->GetAttr()->GetFtn().IsEndNote() )
|
|
|
|
{
|
|
|
|
if ( _bCollectOnlyPreviousFtns )
|
|
|
|
{
|
|
|
|
SwFtnBossFrm* pBossOfFoundFtn = _pFtn->FindFtnBossFrm( sal_True );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pBossOfFoundFtn,
|
2003-04-17 15:07:07 +00:00
|
|
|
"<SwFtnBossFrm::_CollectFtns(..)> - footnote boss frame of found footnote frame missing.\nWrong layout!" );
|
|
|
|
if ( !pBossOfFoundFtn || // don't crash, if no footnote boss is found.
|
|
|
|
pBossOfFoundFtn->IsBefore( _pRefFtnBossFrm )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
bCollectFoundFtn = sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bCollectFoundFtn = sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( bCollectFoundFtn )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !_pFtn->GetMaster(), "FollowFtn moven?" );
|
2003-04-17 15:07:07 +00:00
|
|
|
SwFtnFrm *pNxt = _pFtn->GetFollow();
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pNxt )
|
|
|
|
{
|
|
|
|
SwFrm *pCnt = pNxt->ContainsAny();
|
|
|
|
if ( pCnt )
|
|
|
|
{ //Unterwegs wird der Follow zerstoert weil er leer wird!
|
|
|
|
do
|
|
|
|
{ SwFrm *pNxtCnt = pCnt->GetNext();
|
|
|
|
pCnt->Cut();
|
2003-04-17 15:07:07 +00:00
|
|
|
pCnt->Paste( _pFtn );
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt = pNxtCnt;
|
|
|
|
} while ( pCnt );
|
|
|
|
}
|
|
|
|
else
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !pNxt, "Fussnote ohne Inhalt?" );
|
2000-09-18 23:08:29 +00:00
|
|
|
pNxt->Cut();
|
|
|
|
delete pNxt;
|
|
|
|
}
|
2003-04-17 15:07:07 +00:00
|
|
|
pNxt = _pFtn->GetFollow();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2003-04-17 15:07:07 +00:00
|
|
|
_pFtn->Cut();
|
|
|
|
FtnInArr( _rFtnArr, _pFtn );
|
2011-01-17 15:06:54 +01:00
|
|
|
bFound = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-04-17 15:07:07 +00:00
|
|
|
FtnInArr( aNotFtnArr, _pFtn );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( bFound )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( pNxtFtn &&
|
2003-04-17 15:07:07 +00:00
|
|
|
USHRT_MAX == _rFtnArr.GetPos( (VoidPtr)pNxtFtn ) &&
|
2000-09-18 23:08:29 +00:00
|
|
|
USHRT_MAX == aNotFtnArr.GetPos( (VoidPtr)pNxtFtn ) )
|
2003-04-17 15:07:07 +00:00
|
|
|
_pFtn = pNxtFtn;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::_MoveFtns()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//Alle Fussnoten die von pRef referenziert werden muessen von der
|
|
|
|
//aktuellen Position, die sich durch die alte Spalte/Seite ergab, auf eine
|
|
|
|
//neue Position, bestimmt durch die neue Spalte/Seite, gemoved werden.
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nMyNum = FindPageFrm()->GetPhyPageNum();
|
|
|
|
const sal_uInt16 nMyCol = lcl_ColumnNum( this );
|
2001-10-08 13:10:07 +00:00
|
|
|
SWRECTFN( this )
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2004-06-28 12:00:03 +00:00
|
|
|
// --> OD 2004-06-11 #i21478# - keep last inserted footnote in order to
|
|
|
|
// format the content of the following one.
|
|
|
|
SwFtnFrm* pLastInsertedFtn = 0L;
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rFtnArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwFtnFrm *pFtn = (SwFtnFrm*)rFtnArr[i];
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFtnBossFrm* pRefBoss = pFtn->GetRef()->FindFtnBossFrm( sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pRefBoss != this )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nRefNum = pRefBoss->FindPageFrm()->GetPhyPageNum();
|
|
|
|
const sal_uInt16 nRefCol = lcl_ColumnNum( this );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( nRefNum < nMyNum || ( nRefNum == nMyNum && nRefCol <= nMyCol ) )
|
|
|
|
pRefBoss = this;
|
|
|
|
}
|
|
|
|
pRefBoss->InsertFtn( pFtn );
|
|
|
|
|
|
|
|
if ( pFtn->GetUpper() ) //Robust, z.B. bei doppelten
|
|
|
|
{
|
|
|
|
// Damit FtnFrms, die nicht auf die Seite passen, nicht fuer zuviel
|
|
|
|
// Unruhe sorgen (Loop 66312), wird ihr Inhalt zunaechst zusammengestaucht.
|
|
|
|
// Damit wird der FtnCont erst gegrowt, wenn der Inhalt formatiert wird
|
|
|
|
// und feststellt, dass er auf die Seite passt.
|
|
|
|
SwFrm *pCnt = pFtn->ContainsAny();
|
|
|
|
while( pCnt )
|
|
|
|
{
|
|
|
|
if( pCnt->IsLayoutFrm() )
|
|
|
|
{
|
|
|
|
SwFrm* pTmp = ((SwLayoutFrm*)pCnt)->ContainsAny();
|
|
|
|
while( pTmp && ((SwLayoutFrm*)pCnt)->IsAnLower( pTmp ) )
|
|
|
|
{
|
|
|
|
pTmp->Prepare( PREP_MOVEFTN );
|
2001-10-08 13:10:07 +00:00
|
|
|
(pTmp->Frm().*fnRect->fnSetHeight)(0);
|
|
|
|
(pTmp->Prt().*fnRect->fnSetHeight)(0);
|
2000-09-18 23:08:29 +00:00
|
|
|
pTmp = pTmp->FindNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCnt->Prepare( PREP_MOVEFTN );
|
2001-10-08 13:10:07 +00:00
|
|
|
(pCnt->Frm().*fnRect->fnSetHeight)(0);
|
|
|
|
(pCnt->Prt().*fnRect->fnSetHeight)(0);
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt = pCnt->GetNext();
|
|
|
|
}
|
2001-10-08 13:10:07 +00:00
|
|
|
(pFtn->Frm().*fnRect->fnSetHeight)(0);
|
|
|
|
(pFtn->Prt().*fnRect->fnSetHeight)(0);
|
2000-09-18 23:08:29 +00:00
|
|
|
pFtn->Calc();
|
|
|
|
pFtn->GetUpper()->Calc();
|
|
|
|
|
|
|
|
if( bCalc )
|
|
|
|
{
|
|
|
|
SwTxtFtn *pAttr = pFtn->GetAttr();
|
|
|
|
pCnt = pFtn->ContainsAny();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bUnlock = !pFtn->IsBackMoveLocked();
|
2000-09-18 23:08:29 +00:00
|
|
|
pFtn->LockBackMove();
|
|
|
|
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383# - disable unlock of position of
|
|
|
|
// lower objects during format of footnote content.
|
|
|
|
pFtn->KeepLockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// SwLayNotify aFtnFrmNotitfy( pFtn );
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
|
|
|
|
{
|
|
|
|
pCnt->_InvalidatePos();
|
|
|
|
pCnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
|
|
|
|
{
|
|
|
|
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
|
|
|
|
*(pCnt->FindPageFrm()) ) )
|
|
|
|
{
|
|
|
|
// restart format with first content
|
|
|
|
pCnt = pFtn->ContainsAny();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pCnt->IsSctFrm() )
|
|
|
|
{ // Wenn es sich um einen nichtleeren Bereich handelt,
|
|
|
|
// iterieren wir auch ueber seinen Inhalt
|
|
|
|
SwFrm* pTmp = ((SwSectionFrm*)pCnt)->ContainsAny();
|
|
|
|
if( pTmp )
|
|
|
|
pCnt = pTmp;
|
|
|
|
else
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
}
|
2001-08-17 11:22:48 +00:00
|
|
|
if( bUnlock )
|
|
|
|
{
|
|
|
|
pFtn->UnlockBackMove();
|
|
|
|
if( !pFtn->ContainsAny() && !pFtn->IsColLocked() )
|
|
|
|
{
|
|
|
|
pFtn->Cut();
|
|
|
|
delete pFtn;
|
2004-06-28 12:00:03 +00:00
|
|
|
// --> OD 2004-06-10 #i21478#
|
|
|
|
pFtn = 0L;
|
2001-08-17 11:22:48 +00:00
|
|
|
}
|
|
|
|
}
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383#
|
|
|
|
if ( pFtn )
|
|
|
|
{
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// enable lock of lower object position before format of footnote frame.
|
2005-09-28 10:12:51 +00:00
|
|
|
pFtn->UnlockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
pFtn->Calc();
|
|
|
|
// pFtn->UnlockPosOfLowerObjs();
|
|
|
|
// <--
|
2005-09-28 10:12:51 +00:00
|
|
|
}
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// aFtnFrmNotitfy.FrmDeleted();
|
|
|
|
// }
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2010-11-25 17:08:45 +01:00
|
|
|
{ OSL_ENSURE( !pFtn->GetMaster() && !pFtn->GetFollow(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"DelFtn und Master/Follow?" );
|
|
|
|
delete pFtn;
|
2004-06-28 12:00:03 +00:00
|
|
|
// --> OD 2004-06-10 #i21478#
|
|
|
|
pFtn = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// --> OD 2004-06-10 #i21478#
|
|
|
|
if ( pFtn )
|
|
|
|
{
|
|
|
|
pLastInsertedFtn = pFtn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// --> OD 2004-06-10 #i21478# - format content of footnote following
|
|
|
|
// the new inserted ones.
|
|
|
|
if ( bCalc && pLastInsertedFtn )
|
|
|
|
{
|
|
|
|
if ( pLastInsertedFtn->GetNext() )
|
|
|
|
{
|
|
|
|
SwFtnFrm* pNextFtn = static_cast<SwFtnFrm*>(pLastInsertedFtn->GetNext());
|
|
|
|
SwTxtFtn* pAttr = pNextFtn->GetAttr();
|
|
|
|
SwFrm* pCnt = pNextFtn->ContainsAny();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bUnlock = !pNextFtn->IsBackMoveLocked();
|
2004-06-28 12:00:03 +00:00
|
|
|
pNextFtn->LockBackMove();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383# - disable unlock of position of
|
|
|
|
// lower objects during format of footnote content.
|
|
|
|
pNextFtn->KeepLockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// SwLayNotify aFtnFrmNotitfy( pNextFtn );
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
2004-06-28 12:00:03 +00:00
|
|
|
|
|
|
|
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
|
|
|
|
{
|
|
|
|
pCnt->_InvalidatePos();
|
|
|
|
pCnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
|
|
|
|
{
|
|
|
|
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
|
|
|
|
*(pCnt->FindPageFrm()) ) )
|
|
|
|
{
|
|
|
|
// restart format with first content
|
|
|
|
pCnt = pNextFtn->ContainsAny();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2004-06-28 12:00:03 +00:00
|
|
|
if( pCnt->IsSctFrm() )
|
|
|
|
{ // Wenn es sich um einen nichtleeren Bereich handelt,
|
|
|
|
// iterieren wir auch ueber seinen Inhalt
|
|
|
|
SwFrm* pTmp = ((SwSectionFrm*)pCnt)->ContainsAny();
|
|
|
|
if( pTmp )
|
|
|
|
pCnt = pTmp;
|
|
|
|
else
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
}
|
|
|
|
if( bUnlock )
|
|
|
|
{
|
|
|
|
pNextFtn->UnlockBackMove();
|
|
|
|
}
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383#
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// enable lock of lower object position before format of footnote frame.
|
2005-09-28 10:12:51 +00:00
|
|
|
pNextFtn->UnlockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
pNextFtn->Calc();
|
|
|
|
// pNextFtn->UnlockPosOfLowerObjs();
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::MoveFtns()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|
|
|
|
SwTxtFtn *pAttr )
|
|
|
|
{
|
|
|
|
if( ( GetFmt()->GetDoc()->GetFtnInfo().ePos == FTNPOS_CHAPTER &&
|
|
|
|
(!GetUpper()->IsSctFrm() || !((SwSectionFrm*)GetUpper())->IsFtnAtEnd()))
|
|
|
|
|| pAttr->GetFtn().IsEndNote() )
|
|
|
|
return;
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( this == pSrc->FindFtnBossFrm( TRUE ),
|
2000-09-18 23:08:29 +00:00
|
|
|
"SwPageFrm::MoveFtns: source frame isn't on that FtnBoss" );
|
|
|
|
|
|
|
|
SwFtnFrm *pFtn = FindFirstFtn();
|
|
|
|
if( pFtn )
|
|
|
|
{
|
|
|
|
ChangeFtnRef( pSrc, pAttr, pDest );
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFtnBossFrm *pDestBoss = pDest->FindFtnBossFrm( sal_True );
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pDestBoss, "+SwPageFrm::MoveFtns: no destination boss" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pDestBoss ) // robust
|
|
|
|
{
|
|
|
|
SvPtrarr aFtnArr( 5, 5 );
|
|
|
|
pDestBoss->_CollectFtns( pDest, pFtn, aFtnArr );
|
|
|
|
if ( aFtnArr.Count() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
pDestBoss->_MoveFtns( aFtnArr, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwPageFrm* pSrcPage = FindPageFrm();
|
|
|
|
SwPageFrm* pDestPage = pDestBoss->FindPageFrm();
|
|
|
|
// Nur beim Seitenwechsel FtnNum Updaten
|
|
|
|
if( pSrcPage != pDestPage )
|
|
|
|
{
|
|
|
|
if( pSrcPage->GetPhyPageNum() > pDestPage->GetPhyPageNum() )
|
|
|
|
pSrcPage->UpdateFtnNum();
|
|
|
|
pDestPage->UpdateFtnNum();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::RearrangeFtns()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwTxtFtn *pAttr )
|
|
|
|
{
|
|
|
|
//Alle Fussnoten der Spalte/Seite dergestalt anformatieren,
|
|
|
|
//dass sie ggf. die Spalte/Seite wechseln.
|
|
|
|
|
|
|
|
SwSaveFtnHeight aSave( this, nDeadLine );
|
|
|
|
SwFtnFrm *pFtn = FindFirstFtn();
|
|
|
|
if( pFtn && pFtn->GetPrev() && bLock )
|
|
|
|
{
|
|
|
|
SwFtnFrm* pFirst = (SwFtnFrm*)pFtn->GetUpper()->Lower();
|
|
|
|
SwFrm* pCntnt = pFirst->ContainsAny();
|
|
|
|
if( pCntnt )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bUnlock = !pFirst->IsBackMoveLocked();
|
2000-09-18 23:08:29 +00:00
|
|
|
pFirst->LockBackMove();
|
|
|
|
pFirst->Calc();
|
|
|
|
pCntnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCntnt->IsTxtFrm() && pCntnt->IsValid() )
|
|
|
|
{
|
|
|
|
SwObjectFormatter::FormatObjsAtFrm( *pCntnt,
|
|
|
|
*(pCntnt->FindPageFrm()) );
|
|
|
|
}
|
|
|
|
// <--
|
2001-08-17 11:22:48 +00:00
|
|
|
if( bUnlock )
|
|
|
|
pFirst->UnlockBackMove();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
pFtn = FindFirstFtn();
|
|
|
|
}
|
|
|
|
SwDoc *pDoc = GetFmt()->GetDoc();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uLong nFtnPos = pAttr ? ::lcl_FindFtnPos( pDoc, pAttr ) : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFrm *pCnt = pFtn ? pFtn->ContainsAny() : 0;
|
|
|
|
if ( pCnt )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bMore = sal_True;
|
|
|
|
sal_Bool bStart = pAttr == 0; // wenn kein Attribut uebergeben wird, alle bearbeiten
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383# - disable unlock of position of
|
|
|
|
// lower objects during format of footnote and footnote content.
|
|
|
|
SwFtnFrm* pLastFtnFrm( 0L );
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// SwLayNotify* pFtnFrmNotify( 0L );
|
2005-09-28 10:12:51 +00:00
|
|
|
// footnote frame needs to be locked, if <bLock> isn't set.
|
|
|
|
bool bUnlockLastFtnFrm( false );
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
do
|
|
|
|
{
|
|
|
|
if( !bStart )
|
|
|
|
bStart = ::lcl_FindFtnPos( pDoc, pCnt->FindFtnFrm()->GetAttr() )
|
|
|
|
== nFtnPos;
|
|
|
|
if( bStart )
|
2002-11-01 10:39:38 +00:00
|
|
|
{
|
|
|
|
pCnt->_InvalidatePos();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt->_InvalidateSize();
|
|
|
|
pCnt->Prepare( PREP_ADJUST_FRM );
|
2002-11-01 10:39:38 +00:00
|
|
|
SwFtnFrm* pFtnFrm = pCnt->FindFtnFrm();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383#
|
|
|
|
if ( pFtnFrm != pLastFtnFrm )
|
|
|
|
{
|
|
|
|
if ( pLastFtnFrm )
|
|
|
|
{
|
|
|
|
if ( !bLock && bUnlockLastFtnFrm )
|
|
|
|
{
|
|
|
|
pLastFtnFrm->ColUnlock();
|
|
|
|
}
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// enable lock of lower object position before format of footnote frame.
|
2005-09-28 10:12:51 +00:00
|
|
|
pLastFtnFrm->UnlockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
pLastFtnFrm->Calc();
|
|
|
|
// pLastFtnFrm->UnlockPosOfLowerObjs();
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// delete pFtnFrmNotify;
|
|
|
|
// <--
|
2005-09-28 10:12:51 +00:00
|
|
|
if ( !bLock && bUnlockLastFtnFrm &&
|
|
|
|
!pLastFtnFrm->GetLower() &&
|
|
|
|
!pLastFtnFrm->IsColLocked() &&
|
|
|
|
!pLastFtnFrm->IsBackMoveLocked() )
|
|
|
|
{
|
|
|
|
pLastFtnFrm->Cut();
|
|
|
|
delete pLastFtnFrm;
|
|
|
|
pLastFtnFrm = 0L;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !bLock )
|
|
|
|
{
|
|
|
|
bUnlockLastFtnFrm = !pFtnFrm->IsColLocked();
|
|
|
|
pFtnFrm->ColLock();
|
|
|
|
}
|
|
|
|
pFtnFrm->KeepLockPosOfLowerObjs();
|
|
|
|
pLastFtnFrm = pFtnFrm;
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// pFtnFrmNotify = new SwLayNotify( pLastFtnFrm );
|
|
|
|
// <--
|
2005-09-28 10:12:51 +00:00
|
|
|
}
|
|
|
|
// <--
|
2002-11-01 10:39:38 +00:00
|
|
|
// OD 30.10.2002 #97265# - invalidate position of footnote
|
|
|
|
// frame, if it's below its footnote container, in order to
|
|
|
|
// assure its correct position, probably calculating its previous
|
|
|
|
// footnote frames.
|
|
|
|
{
|
|
|
|
SWRECTFN( this );
|
|
|
|
SwFrm* aFtnContFrm = pFtnFrm->GetUpper();
|
|
|
|
if ( (pFtnFrm->Frm().*fnRect->fnTopDist)((aFtnContFrm->*fnRect->fnGetPrtBottom)()) > 0 )
|
|
|
|
{
|
|
|
|
pFtnFrm->_InvalidatePos();
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bLock )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bUnlock = !pFtnFrm->IsBackMoveLocked();
|
2002-11-01 10:39:38 +00:00
|
|
|
pFtnFrm->LockBackMove();
|
|
|
|
pFtnFrm->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
|
|
|
|
{
|
|
|
|
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
|
|
|
|
*(pCnt->FindPageFrm()) ) )
|
|
|
|
{
|
|
|
|
// restart format with first content
|
|
|
|
pCnt = pFtn->ContainsAny();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2001-08-17 11:22:48 +00:00
|
|
|
if( bUnlock )
|
2001-12-12 13:44:09 +00:00
|
|
|
{
|
2002-11-01 10:39:38 +00:00
|
|
|
pFtnFrm->UnlockBackMove();
|
|
|
|
if( !pFtnFrm->Lower() &&
|
|
|
|
!pFtnFrm->IsColLocked() )
|
2001-12-12 13:44:09 +00:00
|
|
|
{
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-08-10 #i49383#
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pLastFtnFrm == pFtnFrm,
|
2005-09-28 10:12:51 +00:00
|
|
|
"<SwFtnBossFrm::RearrangeFtns(..)> - <pLastFtnFrm> != <pFtnFrm>" );
|
|
|
|
pLastFtnFrm = 0L;
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// pFtnFrmNotify->FrmDeleted();
|
|
|
|
// delete pFtnFrmNotify;
|
2005-09-28 10:12:51 +00:00
|
|
|
// <--
|
2002-11-01 10:39:38 +00:00
|
|
|
pFtnFrm->Cut();
|
|
|
|
delete pFtnFrm;
|
2001-12-12 13:44:09 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-11-01 10:39:38 +00:00
|
|
|
pFtnFrm->Calc();
|
2000-09-18 23:08:29 +00:00
|
|
|
pCnt->Calc();
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-17 #i49383# - format anchored objects
|
|
|
|
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
|
|
|
|
{
|
|
|
|
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
|
|
|
|
*(pCnt->FindPageFrm()) ) )
|
|
|
|
{
|
|
|
|
// restart format with first content
|
|
|
|
pCnt = pFtn->ContainsAny();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
SwSectionFrm *pDel = NULL;
|
|
|
|
if( pCnt->IsSctFrm() )
|
|
|
|
{
|
|
|
|
SwFrm* pTmp = ((SwSectionFrm*)pCnt)->ContainsAny();
|
|
|
|
if( pTmp )
|
|
|
|
{
|
|
|
|
pCnt = pTmp;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
pDel = (SwSectionFrm*)pCnt;
|
|
|
|
}
|
|
|
|
if ( pCnt->GetNext() )
|
|
|
|
pCnt = pCnt->GetNext();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pCnt = pCnt->FindNext();
|
|
|
|
if ( pCnt )
|
|
|
|
{
|
2007-09-27 08:03:19 +00:00
|
|
|
SwFtnFrm* pFtnFrm = pCnt->FindFtnFrm();
|
|
|
|
if( pFtnFrm->GetRef()->FindFtnBossFrm(
|
|
|
|
pFtnFrm->GetAttr()->GetFtn().IsEndNote() ) != this )
|
2011-01-17 15:06:54 +01:00
|
|
|
bMore = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
bMore = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
if( pDel )
|
|
|
|
{
|
|
|
|
pDel->Cut();
|
|
|
|
delete pDel;
|
|
|
|
}
|
|
|
|
if ( bMore )
|
|
|
|
{
|
|
|
|
//Nicht weiter als bis zur angegebenen Fussnote, falls eine
|
|
|
|
//angegeben wurde.
|
|
|
|
if ( pAttr &&
|
|
|
|
(::lcl_FindFtnPos( pDoc,
|
|
|
|
pCnt->FindFtnFrm()->GetAttr()) > nFtnPos ) )
|
2011-01-17 15:06:54 +01:00
|
|
|
bMore = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
} while ( bMore );
|
2005-09-28 10:12:51 +00:00
|
|
|
// --> OD 2005-05-18 #i49383#
|
|
|
|
if ( pLastFtnFrm )
|
|
|
|
{
|
|
|
|
if ( !bLock && bUnlockLastFtnFrm )
|
|
|
|
{
|
|
|
|
pLastFtnFrm->ColUnlock();
|
|
|
|
}
|
2006-02-06 15:30:46 +00:00
|
|
|
// --> OD 2006-02-02 #i57914# - adjust fix #i49383#
|
|
|
|
// enable lock of lower object position before format of footnote frame.
|
2005-09-28 10:12:51 +00:00
|
|
|
pLastFtnFrm->UnlockPosOfLowerObjs();
|
2006-02-06 15:30:46 +00:00
|
|
|
pLastFtnFrm->Calc();
|
|
|
|
// pLastFtnFrm->UnlockPosOfLowerObjs();
|
|
|
|
// no extra notify for footnote frame
|
|
|
|
// delete pFtnFrmNotify;
|
|
|
|
// <--
|
2005-09-28 10:12:51 +00:00
|
|
|
if ( !bLock && bUnlockLastFtnFrm &&
|
|
|
|
!pLastFtnFrm->GetLower() &&
|
|
|
|
!pLastFtnFrm->IsColLocked() &&
|
|
|
|
!pLastFtnFrm->IsBackMoveLocked() )
|
|
|
|
{
|
|
|
|
pLastFtnFrm->Cut();
|
|
|
|
delete pLastFtnFrm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// <--
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwPageFrm::UpdateFtnNum()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
void SwPageFrm::UpdateFtnNum()
|
|
|
|
{
|
|
|
|
//Seitenweise Numerierung nur wenn es am Dokument so eingestellt ist.
|
|
|
|
if ( GetFmt()->GetDoc()->GetFtnInfo().eNum != FTNNUM_PAGE )
|
|
|
|
return;
|
|
|
|
|
|
|
|
SwLayoutFrm* pBody = FindBodyCont();
|
|
|
|
if( !pBody || !pBody->Lower() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
SwCntntFrm* pCntnt = pBody->ContainsCntnt();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nNum = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
while( pCntnt && pCntnt->FindPageFrm() == this )
|
|
|
|
{
|
|
|
|
if( ((SwTxtFrm*)pCntnt)->HasFtn() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFtnBossFrm* pBoss = pCntnt->FindFtnBossFrm( sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pBoss->GetUpper()->IsSctFrm() &&
|
|
|
|
((SwSectionFrm*)pBoss->GetUpper())->IsOwnFtnNum() )
|
|
|
|
pCntnt = ((SwSectionFrm*)pBoss->GetUpper())->FindLastCntnt();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFtnFrm* pFtn = (SwFtnFrm*)pBoss->FindFirstFtn( pCntnt );
|
|
|
|
while( pFtn )
|
|
|
|
{
|
|
|
|
SwTxtFtn* pTxtFtn = pFtn->GetAttr();
|
|
|
|
if( !pTxtFtn->GetFtn().IsEndNote() &&
|
|
|
|
!pTxtFtn->GetFtn().GetNumStr().Len() &&
|
|
|
|
!pFtn->GetMaster() &&
|
|
|
|
(pTxtFtn->GetFtn().GetNumber() != ++nNum) )
|
|
|
|
pTxtFtn->SetNumber( nNum );
|
|
|
|
if ( pFtn->GetNext() )
|
|
|
|
pFtn = (SwFtnFrm*)pFtn->GetNext();
|
|
|
|
else
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFtnBossFrm* pTmpBoss = pFtn->FindFtnBossFrm( sal_True );
|
2007-09-27 08:03:19 +00:00
|
|
|
if( pTmpBoss )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-02-19 17:33:21 +01:00
|
|
|
SwPageFrm* pPage = pTmpBoss->FindPageFrm();
|
|
|
|
pFtn = NULL;
|
2011-03-14 16:51:14 +00:00
|
|
|
lcl_NextFtnBoss( pTmpBoss, pPage, sal_False );
|
2007-09-27 08:03:19 +00:00
|
|
|
SwFtnContFrm *pCont = pTmpBoss->FindNearestFtnCont();
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pCont )
|
|
|
|
pFtn = (SwFtnFrm*)pCont->Lower();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( pFtn && pFtn->GetRef() != pCntnt )
|
|
|
|
pFtn = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pCntnt = pCntnt->FindNextCnt();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::SetFtnDeadLine()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
|
|
|
|
{
|
|
|
|
SwFrm *pBody = FindBodyCont();
|
|
|
|
pBody->Calc();
|
|
|
|
|
|
|
|
SwFrm *pCont = FindFtnCont();
|
|
|
|
const SwTwips nMax = nMaxFtnHeight;//Aktuelle MaxHeight nicht ueberschreiten.
|
2001-10-08 13:10:07 +00:00
|
|
|
SWRECTFN( this )
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pCont )
|
|
|
|
{
|
|
|
|
pCont->Calc();
|
2001-12-12 13:44:09 +00:00
|
|
|
nMaxFtnHeight = -(pCont->Frm().*fnRect->fnBottomDist)( nDeadLine );
|
2001-10-08 13:10:07 +00:00
|
|
|
}
|
|
|
|
else
|
2001-12-12 13:44:09 +00:00
|
|
|
nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
|
2011-01-17 15:06:54 +01:00
|
|
|
nMaxFtnHeight += pBody->Grow( LONG_MAX, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( IsInSct() )
|
2011-01-17 15:06:54 +01:00
|
|
|
nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( nMaxFtnHeight < 0 )
|
|
|
|
nMaxFtnHeight = 0;
|
|
|
|
if ( nMax != LONG_MAX && nMaxFtnHeight > nMax )
|
|
|
|
nMaxFtnHeight = nMax;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::GetVarSpace()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
SwTwips SwFtnBossFrm::GetVarSpace() const
|
|
|
|
{
|
|
|
|
//Fuer Seiten soll ein Wert von 20% der Seitenhoehe nicht unterschritten
|
|
|
|
//werden (->AMA: was macht MS da?)
|
|
|
|
//->AMA: Was ist da fuer Bereiche sinnvoll (und kompatibel zu MS ;-)?
|
|
|
|
//AMA: MS kennt scheinbar kein Begrenzung, die Fussnoten nehmen durchaus
|
|
|
|
// die ganze Seite/Spalte ein.
|
|
|
|
|
|
|
|
const SwPageFrm* pPg = FindPageFrm();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pPg || IsInSct(), "Footnote lost page" );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
const SwFrm *pBody = FindBodyCont();
|
|
|
|
SwTwips nRet;
|
|
|
|
if( pBody )
|
|
|
|
{
|
2001-11-29 14:56:37 +00:00
|
|
|
SWRECTFN( this )
|
|
|
|
if( IsInSct() )
|
|
|
|
{
|
|
|
|
nRet = 0;
|
|
|
|
SwTwips nTmp = (*fnRect->fnYDiff)( (pBody->*fnRect->fnGetPrtTop)(),
|
|
|
|
(Frm().*fnRect->fnGetTop)() );
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwSectionFrm* pSect = FindSctFrm();
|
|
|
|
// Endnotes in a ftncontainer causes a deadline:
|
|
|
|
// the bottom of the last contentfrm
|
|
|
|
if( pSect->IsEndnAtEnd() ) // endnotes allowed?
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !Lower() || !Lower()->GetNext() || Lower()->GetNext()->
|
2000-09-18 23:08:29 +00:00
|
|
|
IsFtnContFrm(), "FtnContainer exspected" );
|
|
|
|
const SwFtnContFrm* pCont = Lower() ?
|
|
|
|
(SwFtnContFrm*)Lower()->GetNext() : 0;
|
|
|
|
if( pCont )
|
|
|
|
{
|
|
|
|
SwFtnFrm* pFtn = (SwFtnFrm*)pCont->Lower();
|
|
|
|
while( pFtn)
|
|
|
|
{
|
|
|
|
if( pFtn->GetAttr()->GetFtn().IsEndNote() )
|
|
|
|
{ // endnote found
|
|
|
|
SwFrm* pFrm = ((SwLayoutFrm*)Lower())->Lower();
|
|
|
|
if( pFrm )
|
|
|
|
{
|
|
|
|
while( pFrm->GetNext() )
|
|
|
|
pFrm = pFrm->GetNext(); // last cntntfrm
|
2001-11-29 14:56:37 +00:00
|
|
|
nTmp += (*fnRect->fnYDiff)(
|
|
|
|
(Frm().*fnRect->fnGetTop)(),
|
|
|
|
(pFrm->Frm().*fnRect->fnGetBottom)() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
pFtn = (SwFtnFrm*)pFtn->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( nTmp < nRet )
|
|
|
|
nRet = nTmp;
|
|
|
|
}
|
|
|
|
else
|
2001-11-29 14:56:37 +00:00
|
|
|
nRet = - (pPg->Prt().*fnRect->fnGetHeight)()/5;
|
|
|
|
nRet += (pBody->Frm().*fnRect->fnGetHeight)();
|
2000-09-18 23:08:29 +00:00
|
|
|
if( nRet < 0 )
|
|
|
|
nRet = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nRet = 0;
|
2006-08-14 15:26:44 +00:00
|
|
|
if ( IsPageFrm() &&
|
|
|
|
GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
|
2000-09-18 23:08:29 +00:00
|
|
|
nRet += BROWSE_HEIGHT - Frm().Height();
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwFtnBossFrm::NeighbourhoodAdjustment(SwFrm*)
|
|
|
|
|*
|
|
|
|
|* gibt Auskunft, ob die Groessenveraenderung von pFrm von AdjustNeighbourhood(...)
|
|
|
|
|* oder von Grow/Shrink(..) verarbeitet werden sollte.
|
|
|
|
|* Bei einem PageFrm oder in Spalten direkt unterhalb der Seite muss AdjustNei..
|
|
|
|
|* gerufen werden, in Rahmenspalten Grow/Shrink.
|
|
|
|
|* Spannend sind die spaltigen Bereiche: Wenn es in der Spalte einen Fussnotencontainer
|
|
|
|
|* gibt und die Fussnoten nicht vom Bereich eingesammelt werden, ist ein Adjust..,
|
|
|
|
|* ansonsten ein Grow/Shrink notwendig.
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt8 SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt8 nRet = NA_ONLY_ADJUST;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( GetUpper() && !GetUpper()->IsPageBodyFrm() )
|
|
|
|
{
|
|
|
|
// Spaltige Rahmen erfordern Grow/Shrink
|
|
|
|
if( GetUpper()->IsFlyFrm() )
|
|
|
|
nRet = NA_GROW_SHRINK;
|
|
|
|
else
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( GetUpper()->IsSctFrm(), "NeighbourhoodAdjustment: Unexspected Upper" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !GetNext() && !GetPrev() )
|
|
|
|
nRet = NA_GROW_ADJUST; // section with a single column (FtnAtEnd)
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwFrm* pTmp = Lower();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pTmp, "NeighbourhoodAdjustment: Missing Lower()" );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pTmp->GetNext() )
|
|
|
|
nRet = NA_GROW_SHRINK;
|
|
|
|
else if( !GetUpper()->IsColLocked() )
|
|
|
|
nRet = NA_ADJUST_GROW;
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( !pTmp->GetNext() || pTmp->GetNext()->IsFtnContFrm(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"NeighbourhoodAdjustment: Who's that guy?" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwPageFrm::SetColMaxFtnHeight()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
void SwPageFrm::SetColMaxFtnHeight()
|
|
|
|
{
|
|
|
|
SwLayoutFrm *pBody = FindBodyCont();
|
|
|
|
if( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrm() )
|
|
|
|
{
|
|
|
|
SwColumnFrm* pCol = (SwColumnFrm*)pBody->Lower();
|
|
|
|
do
|
|
|
|
{
|
|
|
|
pCol->SetMaxFtnHeight( GetMaxFtnHeight() );
|
|
|
|
pCol = (SwColumnFrm*)pCol->GetNext();
|
|
|
|
} while ( pCol );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwLayoutFrm::MoveLowerFtns
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
|
|
|
|
SwFtnBossFrm *pNewBoss, const sal_Bool bFtnNums )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwDoc *pDoc = GetFmt()->GetDoc();
|
|
|
|
if ( !pDoc->GetFtnIdxs().Count() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pDoc->GetFtnInfo().ePos == FTNPOS_CHAPTER &&
|
|
|
|
( !IsInSct() || !FindSctFrm()->IsFtnAtEnd() ) )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( !pNewBoss )
|
2011-01-17 15:06:54 +01:00
|
|
|
pNewBoss = FindFtnBossFrm( sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( pNewBoss == pOldBoss )
|
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 bMoved = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pStart )
|
|
|
|
pStart = ContainsCntnt();
|
|
|
|
|
|
|
|
SvPtrarr aFtnArr( 5, 5 );
|
|
|
|
|
|
|
|
while ( IsAnLower( pStart ) )
|
|
|
|
{
|
|
|
|
if ( ((SwTxtFrm*)pStart)->HasFtn() )
|
2003-04-17 15:07:07 +00:00
|
|
|
{
|
|
|
|
// OD 03.04.2003 #108446# - To avoid unnecessary moves of footnotes
|
|
|
|
// use new parameter <_bCollectOnlyPreviousFtn> (4th parameter of
|
|
|
|
// method <SwFtnBossFrm::CollectFtn(..)>) to control, that only
|
|
|
|
// footnotes have to be collected, that are positioned before the
|
|
|
|
// new dedicated footnote boss frame.
|
|
|
|
pNewBoss->CollectFtns( pStart, pOldBoss, aFtnArr, sal_True );
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
pStart = pStart->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pOldBoss->IsInSct() == pNewBoss->IsInSct(),
|
2000-09-18 23:08:29 +00:00
|
|
|
"MoveLowerFtns: Section confusion" );
|
|
|
|
SvPtrarr *pFtnArr;
|
2007-09-27 08:03:19 +00:00
|
|
|
SwLayoutFrm* pNewChief = 0;
|
|
|
|
SwLayoutFrm* pOldChief = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pStart && pOldBoss->IsInSct() && ( pOldChief = pOldBoss->FindSctFrm() )
|
|
|
|
!= ( pNewChief = pNewBoss->FindSctFrm() ) )
|
|
|
|
{
|
|
|
|
pFtnArr = new SvPtrarr( 5, 5 );
|
2011-01-17 15:06:54 +01:00
|
|
|
pOldChief = pOldBoss->FindFtnBossFrm( sal_True );
|
|
|
|
pNewChief = pNewBoss->FindFtnBossFrm( sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
while( pOldChief->IsAnLower( pStart ) )
|
|
|
|
{
|
|
|
|
if ( ((SwTxtFrm*)pStart)->HasFtn() )
|
|
|
|
((SwFtnBossFrm*)pNewChief)->CollectFtns( pStart,
|
|
|
|
(SwFtnBossFrm*)pOldBoss, *pFtnArr );
|
|
|
|
pStart = pStart->GetNextCntntFrm();
|
|
|
|
}
|
|
|
|
if( !pFtnArr->Count() )
|
|
|
|
{
|
|
|
|
delete pFtnArr;
|
|
|
|
pFtnArr = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pFtnArr = NULL;
|
|
|
|
|
|
|
|
if ( aFtnArr.Count() || pFtnArr )
|
|
|
|
{
|
|
|
|
if( aFtnArr.Count() )
|
2011-01-17 15:06:54 +01:00
|
|
|
pNewBoss->_MoveFtns( aFtnArr, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pFtnArr )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((SwFtnBossFrm*)pNewChief)->_MoveFtns( *pFtnArr, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
delete pFtnArr;
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
bMoved = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// Nur bei einem Seitenwechsel muss die FtnNum neu berechnet werden
|
|
|
|
if ( bFtnNums )
|
|
|
|
{
|
|
|
|
SwPageFrm* pOldPage = pOldBoss->FindPageFrm();
|
|
|
|
SwPageFrm* pNewPage =pNewBoss->FindPageFrm();
|
|
|
|
if( pOldPage != pNewPage )
|
|
|
|
{
|
|
|
|
pOldPage->UpdateFtnNum();
|
|
|
|
pNewPage->UpdateFtnNum();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bMoved;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* SwLayoutFrm::MoveFtnCntFwd()
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwCntntFrm::MoveFtnCntFwd( sal_Bool bMakePage, SwFtnBossFrm *pOldBoss )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( IsInFtn(), "Keine Ftn." );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwLayoutFrm *pFtn = FindFtnFrm();
|
|
|
|
|
|
|
|
// The first paragraph in the first footnote in the first column in the
|
|
|
|
// sectionfrm at the top of the page has not to move forward, if the
|
|
|
|
// columnbody is empty.
|
|
|
|
if( pOldBoss->IsInSct() && !pOldBoss->GetIndPrev() && !GetIndPrev() &&
|
|
|
|
!pFtn->GetPrev() )
|
|
|
|
{
|
|
|
|
SwLayoutFrm* pBody = pOldBoss->FindBodyCont();
|
|
|
|
if( !pBody || !pBody->Lower() )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//fix(9538): Wenn die Ftn noch Nachbarn hinter sich hat, so muessen
|
|
|
|
//diese ersteinmal verschwinden.
|
|
|
|
SwLayoutFrm *pNxt = (SwLayoutFrm*)pFtn->GetNext();
|
|
|
|
SwLayoutFrm *pLst = 0;
|
|
|
|
while ( pNxt )
|
|
|
|
{
|
|
|
|
while ( pNxt->GetNext() )
|
|
|
|
pNxt = (SwLayoutFrm*)pNxt->GetNext();
|
|
|
|
if ( pNxt == pLst )
|
|
|
|
pNxt = 0;
|
|
|
|
else
|
|
|
|
{ pLst = pNxt;
|
|
|
|
SwCntntFrm *pCnt = pNxt->ContainsCntnt();
|
|
|
|
if( pCnt )
|
2011-01-17 15:06:54 +01:00
|
|
|
pCnt->MoveFtnCntFwd( sal_True, pOldBoss );
|
2000-09-18 23:08:29 +00:00
|
|
|
pNxt = (SwLayoutFrm*)pFtn->GetNext();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bSamePage = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwLayoutFrm *pNewUpper =
|
2011-01-17 15:06:54 +01:00
|
|
|
GetLeaf( bMakePage ? MAKEPAGE_INSERT : MAKEPAGE_NONE, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if ( pNewUpper )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bSameBoss = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnBossFrm * const pNewBoss = pNewUpper->FindFtnBossFrm();
|
|
|
|
//Wechseln wir die Spalte/Seite?
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( sal_False == ( bSameBoss = pNewBoss == pOldBoss ) )
|
2003-04-17 15:07:07 +00:00
|
|
|
{
|
|
|
|
bSamePage = pOldBoss->FindPageFrm() == pNewBoss->FindPageFrm(); // Seitenwechsel?
|
2000-09-18 23:08:29 +00:00
|
|
|
pNewUpper->Calc();
|
|
|
|
}
|
|
|
|
|
|
|
|
//Das Layoutblatt, dass wir fuer Fussnoten bekommen ist entweder
|
|
|
|
//ein Fussnotencontainer oder eine Fussnote
|
|
|
|
//Wenn es eine Fussnote ist, und sie die gleiche Fussnotenreferez
|
|
|
|
//wie der alte Upper hat, so moven wir uns direkt hinein.
|
|
|
|
//Ist die Referenz einen andere oder ist es ein Container, so wird
|
|
|
|
//eine neue Fussnote erzeugt und in den Container gestellt.
|
|
|
|
// Wenn wir in einem Bereich innerhalb der Fussnote sind, muss
|
|
|
|
// SectionFrame noch angelegt werden.
|
|
|
|
SwFtnFrm* pTmpFtn = pNewUpper->IsFtnFrm() ? ((SwFtnFrm*)pNewUpper) : 0;
|
|
|
|
if( !pTmpFtn )
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pNewUpper->IsFtnContFrm(), "Neuer Upper kein FtnCont.");
|
2000-09-18 23:08:29 +00:00
|
|
|
SwFtnContFrm *pCont = (SwFtnContFrm*)pNewUpper;
|
|
|
|
|
|
|
|
//Fussnote erzeugen.
|
|
|
|
SwFtnFrm *pOld = FindFtnFrm();
|
|
|
|
pTmpFtn = new SwFtnFrm( pOld->GetFmt()->GetDoc()->GetDfltFrmFmt(),
|
|
|
|
pOld->GetRef(), pOld->GetAttr() );
|
|
|
|
//Verkettung der Fussnoten.
|
|
|
|
if ( pOld->GetFollow() )
|
|
|
|
{
|
|
|
|
pTmpFtn->SetFollow( pOld->GetFollow() );
|
|
|
|
pOld->GetFollow()->SetMaster( pTmpFtn );
|
|
|
|
}
|
|
|
|
pOld->SetFollow( pTmpFtn );
|
|
|
|
pTmpFtn->SetMaster( pOld );
|
|
|
|
SwFrm* pNx = pCont->Lower();
|
|
|
|
if( pNx && pTmpFtn->GetAttr()->GetFtn().IsEndNote() )
|
|
|
|
while(pNx && !((SwFtnFrm*)pNx)->GetAttr()->GetFtn().IsEndNote())
|
|
|
|
pNx = pNx->GetNext();
|
|
|
|
pTmpFtn->Paste( pCont, pNx );
|
|
|
|
pTmpFtn->Calc();
|
|
|
|
}
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pTmpFtn->GetAttr() == FindFtnFrm()->GetAttr(), "Wrong Footnote!" );
|
2000-09-18 23:08:29 +00:00
|
|
|
// Bereiche in Fussnoten beduerfen besonderer Behandlung
|
|
|
|
SwLayoutFrm *pNewUp = pTmpFtn;
|
|
|
|
if( IsInSct() )
|
|
|
|
{
|
|
|
|
SwSectionFrm* pSect = FindSctFrm();
|
|
|
|
// Bereich in Fussnote (oder nur Fussnote in Bereich)?
|
|
|
|
if( pSect->IsInFtn() )
|
|
|
|
{
|
|
|
|
if( pTmpFtn->Lower() && pTmpFtn->Lower()->IsSctFrm() &&
|
|
|
|
pSect->GetFollow() == (SwSectionFrm*)pTmpFtn->Lower() )
|
|
|
|
pNewUp = (SwSectionFrm*)pTmpFtn->Lower();
|
|
|
|
else
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
pNewUp = new SwSectionFrm( *pSect, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
pNewUp->InsertBefore( pTmpFtn, pTmpFtn->Lower() );
|
2002-11-15 10:07:52 +00:00
|
|
|
static_cast<SwSectionFrm*>(pNewUp)->Init();
|
2000-09-18 23:08:29 +00:00
|
|
|
pNewUp->Frm().Pos() = pTmpFtn->Frm().Pos();
|
|
|
|
pNewUp->Frm().Pos().Y() += 1; //wg. Benachrichtigungen.
|
|
|
|
|
|
|
|
// Wenn unser Bereichsframe einen Nachfolger hat, so muss dieser
|
|
|
|
// umgehaengt werden hinter den neuen Follow der Bereichsframes.
|
|
|
|
SwFrm* pTmp = pSect->GetNext();
|
|
|
|
if( pTmp )
|
|
|
|
{
|
2007-09-27 08:03:19 +00:00
|
|
|
SwFlowFrm* pTmpNxt;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pTmp->IsCntntFrm() )
|
2007-09-27 08:03:19 +00:00
|
|
|
pTmpNxt = (SwCntntFrm*)pTmp;
|
2000-09-18 23:08:29 +00:00
|
|
|
else if( pTmp->IsSctFrm() )
|
2007-09-27 08:03:19 +00:00
|
|
|
pTmpNxt = (SwSectionFrm*)pTmp;
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" );
|
2007-09-27 08:03:19 +00:00
|
|
|
pTmpNxt = (SwTabFrm*)pTmp;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2007-09-27 08:03:19 +00:00
|
|
|
pTmpNxt->MoveSubTree( pTmpFtn, pNewUp->GetNext() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoveSubTree( pNewUp, pNewUp->Lower() );
|
|
|
|
|
|
|
|
if( !bSameBoss )
|
|
|
|
Prepare( PREP_BOSS_CHGD );
|
|
|
|
}
|
|
|
|
return bSamePage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* class SwSaveFtnHeight
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
SwSaveFtnHeight::SwSaveFtnHeight( SwFtnBossFrm *pBs, const SwTwips nDeadLine ) :
|
|
|
|
pBoss( pBs ),
|
|
|
|
nOldHeight( pBs->GetMaxFtnHeight() )
|
|
|
|
{
|
|
|
|
pBoss->SetFtnDeadLine( nDeadLine );
|
|
|
|
nNewHeight = pBoss->GetMaxFtnHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwSaveFtnHeight::~SwSaveFtnHeight()
|
|
|
|
{
|
|
|
|
//Wenn zwischendurch jemand an der DeadLine gedreht hat, so lassen wir
|
|
|
|
//ihm seinen Spass!
|
|
|
|
if ( nNewHeight == pBoss->GetMaxFtnHeight() )
|
|
|
|
pBoss->nMaxFtnHeight = nOldHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-25 17:08:45 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2001-10-15 11:50:20 +00:00
|
|
|
//JP 15.10.2001: in a non pro version test if the attribute has the same
|
|
|
|
// meaning which his reference is
|
|
|
|
|
2001-11-07 12:58:33 +00:00
|
|
|
// Normally, the pRef member and the GetRefFromAttr() result has to be
|
|
|
|
// identically. Sometimes footnote will be moved from a master to its follow,
|
|
|
|
// but the GetRef() is called first, so we have to ignore a master/follow
|
|
|
|
// mismatch.
|
|
|
|
|
2001-10-15 11:50:20 +00:00
|
|
|
const SwCntntFrm* SwFtnFrm::GetRef() const
|
|
|
|
{
|
2001-11-07 12:58:33 +00:00
|
|
|
const SwCntntFrm* pRefAttr = GetRefFromAttr();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
|
2001-11-22 14:04:00 +00:00
|
|
|
|| pRefAttr->IsAnFollow( pRef ),
|
2001-11-07 12:58:33 +00:00
|
|
|
"access to deleted Frame? pRef != pAttr->GetRef()" );
|
2001-10-15 11:50:20 +00:00
|
|
|
return pRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
SwCntntFrm* SwFtnFrm::GetRef()
|
|
|
|
{
|
2001-11-07 12:58:33 +00:00
|
|
|
const SwCntntFrm* pRefAttr = GetRefFromAttr();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pRef == pRefAttr || pRef->IsAnFollow( pRefAttr )
|
2001-11-22 14:04:00 +00:00
|
|
|
|| pRefAttr->IsAnFollow( pRef ),
|
2001-11-07 12:58:33 +00:00
|
|
|
"access to deleted Frame? pRef != pAttr->GetRef()" );
|
2001-10-15 11:50:20 +00:00
|
|
|
return pRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
const SwCntntFrm* SwFtnFrm::GetRefFromAttr() const
|
|
|
|
{
|
|
|
|
SwFtnFrm* pThis = (SwFtnFrm*)this;
|
|
|
|
return pThis->GetRefFromAttr();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwCntntFrm* SwFtnFrm::GetRefFromAttr()
|
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pAttr, "invalid Attribute" );
|
2001-10-15 11:50:20 +00:00
|
|
|
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
|
|
|
|
SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
|
2011-01-17 15:06:54 +01:00
|
|
|
SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, sal_False );
|
2001-10-15 11:50:20 +00:00
|
|
|
return pCFrm;
|
|
|
|
}
|
|
|
|
|
2006-02-01 13:24:36 +00:00
|
|
|
/** search for last content in the current footnote frame
|
|
|
|
|
|
|
|
OD 2005-12-02 #i27138#
|
|
|
|
|
|
|
|
@author OD
|
|
|
|
*/
|
|
|
|
SwCntntFrm* SwFtnFrm::FindLastCntnt()
|
|
|
|
{
|
|
|
|
SwCntntFrm* pLastCntntFrm( 0L );
|
|
|
|
|
|
|
|
// find last lower, which is a content frame or contains content.
|
|
|
|
// hidden text frames, empty sections and empty tables have to be skipped.
|
|
|
|
SwFrm* pLastLowerOfFtn( GetLower() );
|
|
|
|
SwFrm* pTmpLastLower( pLastLowerOfFtn );
|
|
|
|
while ( pTmpLastLower && pTmpLastLower->GetNext() )
|
|
|
|
{
|
|
|
|
pTmpLastLower = pTmpLastLower->GetNext();
|
|
|
|
if ( ( pTmpLastLower->IsTxtFrm() &&
|
|
|
|
!static_cast<SwTxtFrm*>(pTmpLastLower)->IsHiddenNow() ) ||
|
|
|
|
( pTmpLastLower->IsSctFrm() &&
|
|
|
|
static_cast<SwSectionFrm*>(pTmpLastLower)->GetSection() &&
|
|
|
|
static_cast<SwSectionFrm*>(pTmpLastLower)->ContainsCntnt() ) ||
|
|
|
|
( pTmpLastLower->IsTabFrm() &&
|
|
|
|
static_cast<SwTabFrm*>(pTmpLastLower)->ContainsCntnt() ) )
|
|
|
|
{
|
|
|
|
pLastLowerOfFtn = pTmpLastLower;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// determine last content frame depending on type of found last lower.
|
|
|
|
if ( pLastLowerOfFtn && pLastLowerOfFtn->IsTabFrm() )
|
|
|
|
{
|
|
|
|
pLastCntntFrm = static_cast<SwTabFrm*>(pLastLowerOfFtn)->FindLastCntnt();
|
|
|
|
}
|
|
|
|
else if ( pLastLowerOfFtn && pLastLowerOfFtn->IsSctFrm() )
|
|
|
|
{
|
|
|
|
pLastCntntFrm = static_cast<SwSectionFrm*>(pLastLowerOfFtn)->FindLastCntnt();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pLastCntntFrm = dynamic_cast<SwCntntFrm*>(pLastLowerOfFtn);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pLastCntntFrm;
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|