summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-02-03 12:19:25 +0100
committerOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-02-03 12:19:25 +0100
commit98946138f642eea0dbe3bf73214f29c30af79948 (patch)
treec6c53ae02d55f60f7879e2bd21779cb37a05e433 /sw/source/filter
parent3fa4c29fb269fbaea5f6c5974b7db7992c6b9f72 (diff)
parent5b7dc4c9b5c1190edce19e568676270f315c31e6 (diff)
merge from master
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ascii/parasc.cxx20
-rw-r--r--sw/source/filter/basflt/shellio.cxx40
-rw-r--r--sw/source/filter/html/htmlbas.cxx8
-rw-r--r--sw/source/filter/html/htmlcss1.cxx2
-rw-r--r--sw/source/filter/html/htmldraw.cxx6
-rw-r--r--sw/source/filter/html/htmlform.cxx4
-rw-r--r--sw/source/filter/html/htmlsect.cxx14
-rw-r--r--sw/source/filter/html/htmltab.cxx21
-rw-r--r--sw/source/filter/html/swhtml.cxx34
-rw-r--r--sw/source/filter/rtf/rtffly.cxx6
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx3
-rw-r--r--sw/source/filter/writer/writer.cxx6
-rw-r--r--sw/source/filter/ww1/fltshell.cxx13
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx3
-rw-r--r--sw/source/filter/ww8/docxexport.cxx3
-rw-r--r--sw/source/filter/ww8/docxfootnotes.hxx1
-rw-r--r--sw/source/filter/ww8/ww8glsy.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx2
-rw-r--r--sw/source/filter/xml/xmliteme.cxx2
21 files changed, 94 insertions, 108 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index 282551474e36..64a261fc8ba0 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -54,6 +54,8 @@
#include <mdiexp.hxx> // ...Percent()
#include <poolfmt.hxx>
+#include "vcl/metric.hxx"
+
#define ASC_BUFFLEN 4096
class SwASCIIParser
@@ -129,24 +131,14 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
}
if( rOpt.GetFontName().Len() )
{
- bool bDelete = false;
- const SfxFont* pFnt = 0;
+ Font aTextFont( rOpt.GetFontName(), Size( 0, 10 ) );
if( pDoc->getPrinter( false ) )
- pFnt = pDoc->getPrinter( false )->GetFontByName( rOpt.GetFontName() );
-
- if( !pFnt )
- {
- pFnt = new SfxFont( FAMILY_DONTKNOW, rOpt.GetFontName() );
- bDelete = true;
- }
- SvxFontItem aFont( pFnt->GetFamily(), pFnt->GetName(),
- aEmptyStr, pFnt->GetPitch(), pFnt->GetCharSet(), RES_CHRATR_FONT );
+ aTextFont = pDoc->getPrinter( false )->GetFontMetric( aTextFont );
+ SvxFontItem aFont( aTextFont.GetFamily(), aTextFont.GetName(),
+ aEmptyStr, aTextFont.GetPitch(), aTextFont.GetCharSet(), RES_CHRATR_FONT );
pItemSet->Put( aFont );
pItemSet->Put( aFont, RES_CHRATR_CJK_FONT );
pItemSet->Put( aFont, RES_CHRATR_CTL_FONT );
-
- if( bDelete )
- delete (SfxFont*)pFnt;
}
}
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 963c5c847500..80ed9630318c 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
@@ -46,6 +47,7 @@
#include <swtypes.hxx>
#include <shellio.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <editsh.hxx>
#include <undobj.hxx> // fuer Undo Insert-Dokument
@@ -131,7 +133,7 @@ ULONG SwReader::Read( const Reader& rOptions )
SwUndoInsDoc* pUndo = 0;
BOOL bReadPageDescs = FALSE;
- BOOL bDocUndo = pDoc->DoesUndo();
+ bool const bDocUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
BOOL bSaveUndo = bDocUndo && pCrsr;
if( bSaveUndo )
{
@@ -139,15 +141,15 @@ ULONG SwReader::Read( const Reader& rOptions )
if( 0 != ( bReadPageDescs = po->aOpt.IsPageDescs() ) )
{
bSaveUndo = FALSE;
- pDoc->DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
}
else
{
- pDoc->ClearRedo();
- pDoc->StartUndo( UNDO_INSDOKUMENT, NULL );
+ pDoc->GetIDocumentUndoRedo().ClearRedo();
+ pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_INSDOKUMENT, NULL );
}
}
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
SwNodeIndex aSplitIdx( pDoc->GetNodes() );
@@ -270,7 +272,11 @@ ULONG SwReader::Read( const Reader& rOptions )
if( bSaveUndo )
{
pDoc->SetRedlineMode_intern( eOld );
- pDoc->AppendUndo( new SwUndoInsLayFmt( pFrmFmt,0,0 ) );
+ // UGLY: temp. enable undo
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ pDoc->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoInsLayFmt( pFrmFmt,0,0 ) );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
if( pFrmFmt->GetDepends() )
@@ -314,7 +320,10 @@ ULONG SwReader::Read( const Reader& rOptions )
{
pDoc->SetRedlineMode_intern( eOld );
pUndo->SetInsertRange( *pUndoPam, FALSE );
- pDoc->AppendUndo( pUndo );
+ // UGLY: temp. enable undo
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
@@ -348,15 +357,13 @@ ULONG SwReader::Read( const Reader& rOptions )
pDoc->ChkCondColls();
pDoc->SetAllUniqueFlyNames();
- if( bReadPageDescs )
- pDoc->DoUndo( TRUE );
- else
+ pDoc->GetIDocumentUndoRedo().DoUndo(bDocUndo);
+ if (!bReadPageDescs)
{
- pDoc->DoUndo( bDocUndo );
if( bSaveUndo )
{
pDoc->SetRedlineMode_intern( eOld );
- pDoc->EndUndo( UNDO_INSDOKUMENT, NULL );
+ pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_INSDOKUMENT, NULL );
pDoc->SetRedlineMode_intern( nsRedlineMode_t::REDLINE_IGNORE );
}
}
@@ -530,12 +537,13 @@ SwDoc* Reader::GetTemplateDoc()
{
SwDocShell *pDocSh =
new SwDocShell ( SFX_CREATE_MODE_INTERNAL );
- SfxObjectShellRef xDocSh = pDocSh;
+ SfxObjectShellLock xDocSh = pDocSh;
if( pDocSh->DoInitNew( 0 ) )
{
pTemplate = pDocSh->GetDoc();
pTemplate->SetOle2Link( Link() );
- pTemplate->DoUndo( FALSE ); // always FALSE
+ // always FALSE
+ pTemplate->GetIDocumentUndoRedo().DoUndo( false );
pTemplate->set(IDocumentSettingAccess::BROWSE_MODE, bTmplBrowseMode );
pTemplate->RemoveAllFmtLanguageDependencies();
@@ -805,15 +813,12 @@ ULONG SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName )
SwPaM * pPam;
SwDoc *pDoc = 0;
- SfxObjectShellRef* pRefForDocSh = 0;
if ( pShell && !bWriteAll && pShell->IsTableMode() )
{
bWriteAll = TRUE;
pDoc = new SwDoc;
pDoc->acquire();
- pRefForDocSh = new SfxObjectShellRef();
- pDoc->SetRefForDocShell( pRefForDocSh );
// kopiere Teile aus einer Tabelle: lege eine Tabelle mit der Breite
// von der Originalen an und kopiere die selectierten Boxen.
@@ -971,7 +976,6 @@ ULONG SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName )
if ( pDoc )
{
- delete pRefForDocSh;
if ( !pDoc->release() )
delete pDoc;
bWriteAll = FALSE;
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 6a6bcc04b34c..c81547e66213 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -271,8 +271,7 @@ void SwHTMLParser::InsertBasicDocEvent( rtl::OUString aEvent, const String& rNam
rtl::OUString aEventName;
- SfxEventConfiguration* pECfg = SFX_APP()->GetEventConfig();
- pECfg->ConfigureEvent( aEvent, SvxMacro( sEvent, sScriptType, eScrType ),
+ SfxEventConfiguration::ConfigureEvent( aEvent, SvxMacro( sEvent, sScriptType, eScrType ),
pDocSh );
}
@@ -281,14 +280,11 @@ void SwHTMLWriter::OutBasic()
if( !bCfgStarBasic )
return;
- SFX_APP()->EnterBasicCall();
-
BasicManager *pBasicMan = pDoc->GetDocShell()->GetBasicManager();
ASSERT( pBasicMan, "Wo ist der Basic-Manager?" );
//JP 17.07.96: Bug 29538 - nur das DocumentBasic schreiben
if( !pBasicMan || pBasicMan == SFX_APP()->GetBasicManager() )
{
- SFX_APP()->LeaveBasicCall();
return;
}
@@ -335,8 +331,6 @@ void SwHTMLWriter::OutBasic()
eDestEnc, &aNonConvertableCharacters );
}
}
-
- SFX_APP()->LeaveBasicCall();
}
static const char* aEventNames[] =
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 9d05d833c2d2..fdc5f5f90452 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2077,7 +2077,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/,
// sie nicht schon in einem Rahmen stehen und sonst
// Rahmengebunden.
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
aAnchor.SetType( FLY_AT_FLY );
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index e0f8be92c93e..e973ad3df26d 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -183,7 +183,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType )
{
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
@@ -446,8 +446,8 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
0
};
- const SwTxtNode *pTxtNd = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ SwTxtNode const*const pTxtNd =
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode();
if( pTxtNd )
{
const SfxItemSet& rItemSet = pTxtNd->GetAnyFmtColl().GetAttrSet();
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index a8c0aedc388f..d45202d88c48 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -544,7 +544,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
SwNode *pANd;
SwTableNode *pTblNd;
if( pAPos &&
- 0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
+ 0 != (pANd = & pAPos->nNode.GetNode()) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
const sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
@@ -1171,7 +1171,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType )
{
const SwStartNode *pFlySttNd =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->FindFlyStartNode();
+ pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
if( pFlySttNd )
{
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index ac2f348532e8..6494e07f15ad 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -204,7 +204,7 @@ void SwHTMLParser::NewDivision( int nToken )
aDelPam.SetMark();
const SwStartNode *pStNd =
- (const SwStartNode *)pDoc->GetNodes()[rCntntStIdx];
+ (const SwStartNode *) &rCntntStIdx.GetNode();
aDelPam.GetPoint()->nNode = pStNd->EndOfSectionIndex() - 1;
pDoc->DelFullPara( aDelPam );
@@ -261,7 +261,7 @@ void SwHTMLParser::NewDivision( int nToken )
if( !bAppended )
{
SwNodeIndex aPrvNdIdx( pPam->GetPoint()->nNode, -1 );
- if( (pDoc->GetNodes()[aPrvNdIdx])->IsSectionNode() )
+ if (aPrvNdIdx.GetNode().IsSectionNode())
{
AppendTxtNode();
bAppended = sal_True;
@@ -350,8 +350,7 @@ void SwHTMLParser::NewDivision( int nToken )
}
SwTxtNode* pOldTxtNd =
- bAppended ? 0 : pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ (bAppended) ? 0 : pPam->GetPoint()->nNode.GetNode().GetTxtNode();
pPam->Move( fnMoveBackward );
@@ -438,7 +437,7 @@ void SwHTMLParser::FixHeaderFooterDistance( sal_Bool bHeader,
ULONG nPrvNxtIdx;
if( bHeader )
{
- nPrvNxtIdx = pDoc->GetNodes()[rCntntStIdx]->EndOfSectionIndex()-1;
+ nPrvNxtIdx = rCntntStIdx.GetNode().EndOfSectionIndex()-1;
}
else
{
@@ -689,7 +688,7 @@ void SwHTMLParser::NewMultiCol()
// node must be inserted. Otherwise, the new section will be
// inserted in front of the old one.
SwNodeIndex aPrvNdIdx( pPam->GetPoint()->nNode, -1 );
- if( (pDoc->GetNodes()[aPrvNdIdx])->IsSectionNode() )
+ if (aPrvNdIdx.GetNode().IsSectionNode())
{
AppendTxtNode();
bAppended = sal_True;
@@ -745,8 +744,7 @@ void SwHTMLParser::NewMultiCol()
}
SwTxtNode* pOldTxtNd =
- bAppended ? 0 : pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->GetTxtNode();
+ (bAppended) ? 0 : pPam->GetPoint()->nNode.GetNode().GetTxtNode();
pPam->Move( fnMoveBackward );
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index df9f43fafa41..111fce4863dc 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2894,7 +2894,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection
const SwStartNode *pStNd;
if( pTable && pTable->bFirstCell )
{
- SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode *const pNd = & pPam->GetPoint()->nNode.GetNode();
pNd->GetTxtNode()->ChgFmtColl( pColl );
pStNd = pNd->FindTableBoxStartNode();
pTable->bFirstCell = sal_False;
@@ -2937,7 +2937,7 @@ const SwStartNode *SwHTMLParser::InsertTableSection( sal_uInt16 nPoolId )
SwTxtFmtColl *pColl = pCSS1Parser->GetTxtCollFromPool( nPoolId );
- SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode *const pNd = & pPam->GetPoint()->nNode.GetNode();
const SwStartNode *pStNd;
if( pTable && pTable->bFirstCell )
{
@@ -3453,7 +3453,7 @@ void _CellSaveStruct::EndNoBreak( const SwPosition& rPos )
}
}
-void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc *pDoc )
+void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc * /*pDoc*/ )
{
if( pCnts && pCurrCnts==pCnts )
{
@@ -3472,8 +3472,7 @@ void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc *pDoc )
}
else if( nNoBreakEndCntntPos + 1 == rPos.nContent.GetIndex() )
{
- const SwTxtNode *pTxtNd =
- pDoc->GetNodes()[rPos.nNode]->GetTxtNode();
+ SwTxtNode const*const pTxtNd(rPos.nNode.GetNode().GetTxtNode());
if( pTxtNd )
{
sal_Unicode cLast =
@@ -3866,11 +3865,11 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
pPam->Move( fnMoveBackward );
}
- const SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode const*const pNd = & pPam->GetPoint()->nNode.GetNode();
if( !bAppended && !bForceFrame )
{
- SwTxtNode* pOldTxtNd =
- pDoc->GetNodes()[pSavePos->nNode]->GetTxtNode();
+ SwTxtNode *const pOldTxtNd =
+ pSavePos->nNode.GetNode().GetTxtNode();
ASSERT( pOldTxtNd, "Wieso stehen wir in keinem Txt-Node?" );
SwFrmFmt *pFrmFmt = pSwTable->GetFrmFmt();
@@ -3939,7 +3938,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
}
}
- const SwNode *pNd = pDoc->GetNodes()[pPam->GetPoint()->nNode];
+ SwNode const*const pNd = & pPam->GetPoint()->nNode.GetNode();
const SwStartNode *pStNd = (pTable->bFirstCell ? pNd->FindTableNode()
: pNd->FindTableBoxStartNode() );
@@ -4043,8 +4042,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
// koennen wir erneut eine echte Tabelle aufmachen.
// Wir erkennen das daran, dass wir keinen
// Tabellen-Node mehr finden.
- bTopTable = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->FindTableNode() == 0;
+ bTopTable = (0 ==
+ pPam->GetPoint()->nNode.GetNode().FindTableNode());
// Wenn im aktuellen Absatz Flys verankert sind,
// muss die neue Tabelle in einen Rahmen.
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 230da033d50c..2ba3388d767a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -87,6 +87,7 @@
#include <docary.hxx>
#include <docstat.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <mdiexp.hxx> // ...Percent()
@@ -109,9 +110,7 @@
#include <sfx2/viewfrm.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // ResId fuer Statusleiste
-#endif
#include <swerror.h>
#define FONTSIZE_MASK 7
@@ -631,8 +630,8 @@ void __EXPORT SwHTMLParser::Continue( int nToken )
pDoc->SetOle2Link( Link() );
BOOL bModified = pDoc->IsModified();
- BOOL bWasUndo = pDoc->DoesUndo();
- pDoc->DoUndo( FALSE );
+ bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
// Wenn der Import abgebrochen wird, kein Continue mehr rufen.
// Falls ein Pending-Stack existiert aber durch einen Aufruf
@@ -889,8 +888,8 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() )
{
if( bWasUndo )
{
- pDoc->DelAllUndoObj();
- pDoc->DoUndo( TRUE );
+ pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
}
else if( !pInitVSh )
{
@@ -900,7 +899,9 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() )
// wir muessen das Undo noch anschalten.
ViewShell *pTmpVSh = CheckActionViewShell();
if( pTmpVSh )
- pDoc->DoUndo( TRUE );
+ {
+ pDoc->GetIDocumentUndoRedo().DoUndo(true);
+ }
}
pDoc->SetOle2Link( aOLELink );
@@ -951,7 +952,7 @@ void SwHTMLParser::DocumentDetected()
CallEndAction( TRUE, TRUE );
- pDoc->DoUndo( FALSE );
+ pDoc->GetIDocumentUndoRedo().DoUndo(false);
// Durch das DocumentDetected wurde im allgemeinen eine
// ViewShell angelegt. Es kann aber auch sein, dass sie
// erst spaeter angelegt wird, naemlich dann, wenn die UI
@@ -1461,8 +1462,7 @@ void __EXPORT SwHTMLParser::NextToken( int nToken )
if( nPos )
{
const String& rText =
- pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->GetTxtNode()
- ->GetTxt();
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode()->GetTxt();
sal_Unicode cLast = rText.GetChar(--nPos);
if( ' ' == cLast || '\x0a' == cLast)
aToken.Erase(0,1);
@@ -2111,7 +2111,7 @@ BOOL SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, BOOL bUpdateNum )
if( AM_SPACE==eMode || AM_NOSPACE==eMode )
{
SwTxtNode *pTxtNode =
- pDoc->GetNodes()[pPam->GetPoint()->nNode]->GetTxtNode();
+ pPam->GetPoint()->nNode.GetNode().GetTxtNode();
const SvxULSpaceItem& rULSpace =
(const SvxULSpaceItem&)pTxtNode->SwCntntNode::GetAttr( RES_UL_SPACE );
@@ -2426,8 +2426,10 @@ void SwHTMLParser::Show()
// ist der aktuelle Node nicht mehr sichtbar, dann benutzen wir
// eine groessere Schrittweite
if( pVSh )
- nParaCnt = pDoc->GetNodes()[pPam->GetPoint()->nNode]
- ->IsInVisibleArea(pVSh) ? 5 : 50;
+ {
+ nParaCnt = (pPam->GetPoint()->nNode.GetNode().IsInVisibleArea(pVSh))
+ ? 5 : 50;
+ }
}
void SwHTMLParser::ShowStatline()
@@ -2656,7 +2658,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
}
- pCNd = pDoc->GetNodes()[ pAttr->nSttPara ]->GetCntntNode();
+ pCNd = pAttr->nSttPara.GetNode().GetCntntNode();
if( !pCNd )
{
// durch die elende Loescherei von Nodes kann auch mal
@@ -2696,7 +2698,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
if ( (pAttr->GetSttPara() != pAttr->GetEndPara()) &&
!isTXTATR_NOEND(nWhich) )
{
- pCNd = pDoc->GetNodes()[ pAttr->nEndPara ]->GetCntntNode();
+ pCNd = pAttr->nEndPara.GetNode().GetCntntNode();
if( !pCNd )
{
pCNd = pDoc->GetNodes().GoPrevious( &(pAttr->nEndPara) );
@@ -2888,7 +2890,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable,
{
pAttr = aFields[0];
- pCNd = pDoc->GetNodes()[ pAttr->nSttPara ]->GetCntntNode();
+ pCNd = pAttr->nSttPara.GetNode().GetCntntNode();
pAttrPam->GetPoint()->nNode = pAttr->nSttPara;
pAttrPam->GetPoint()->nContent.Assign( pCNd, pAttr->nSttCntnt );
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 5303ad26dcba..0309d85833ed 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -115,7 +115,7 @@ int SwFlySave::IsEqualFly( const SwPaM& rPos, SfxItemSet& rSet )
else
{
SwNodeIndex aIdx( nEndNd );
- SwCntntNode* pCNd = rPos.GetDoc()->GetNodes()[ aIdx ]->GetCntntNode();
+ SwCntntNode *const pCNd = aIdx.GetNode().GetCntntNode();
if( !GoNextNds( &aIdx, TRUE ) ||
aIdx.GetIndex() != rPos.GetPoint()->nNode.GetIndex() ||
( pCNd && pCNd->Len() != nEndCnt ))
@@ -287,7 +287,7 @@ void SwRTFParser::SetFlysInDoc()
if( n + 1 < aFlyArr.Count() && pFlySave->nEndCnt &&
pFlySave->nEndNd == aFlyArr[ n + 1 ]->nSttNd )
{
- SwCntntNode* pCNd = rNds[ pFlySave->nEndNd ]->GetCntntNode();
+ SwCntntNode *const pCNd = pFlySave->nEndNd.GetNode().GetCntntNode();
if( pCNd )
{
SwPosition aPos( pFlySave->nEndNd,
@@ -1375,7 +1375,7 @@ void SwRTFParser::_SetPictureSize( const SwNoTxtNode& rNd,
}
//steht der Fly etwa in einer Tabelle ?
- const SwNode* pAnchorNd = pDoc->GetNodes()[ rAnchor ];
+ const SwNode* pAnchorNd = & rAnchor.GetNode();
const SwTableNode* pTblNd = pAnchorNd->FindTableNode();
if( pTblNd )
{
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 6737ebce596e..8a7f38044ecb 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -181,7 +181,7 @@ void SwRTFParser::ReadTable( int nToken )
// wenn schon in einer Tabellen, dann splitte oder benutze
// die bisherigen Boxen weiter
- bChkExistTbl = 0 != pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->FindTableNode();
+ bChkExistTbl = 0 != pPam->GetPoint()->nNode.GetNode().FindTableNode();
}
else
{
@@ -919,7 +919,7 @@ void SwRTFParser::GotoNextBox()
// dann hinter die Tabelle
pPam->Move( fnMoveForward, fnGoNode );
}
- else if( !pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->IsCntntNode() )
+ else if (pPam->GetPoint()->nNode.GetNode().IsCntntNode())
// dann in die vorherige ans Ende
pPam->Move( fnMoveBackward, fnGoCntnt );
}
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 0c23218092d5..629c7f068dc9 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1015,8 +1015,7 @@ void rtfSections::InsertSegments(bool bNewDoc)
}
const SwPosition* pPos = aSectPaM.GetPoint();
- const SwTxtNode* pSttNd =
- mrReader.pDoc->GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : 0;
if (pTableNd)
{
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 2a77d47dd65b..f11cbd751c8e 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -223,10 +223,10 @@ sal_Int32 Writer::FindPos_Bkmk(const SwPosition& rPos) const
}
-SwPaM* Writer::NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx,
- BOOL bNodesArray )
+SwPaM *
+Writer::NewSwPaM(SwDoc & rDoc, ULONG const nStartIdx, ULONG const nEndIdx)
{
- SwNodes* pNds = bNodesArray ? &rDoc.GetNodes() : (SwNodes*)rDoc.GetUndoNds();
+ SwNodes *const pNds = &rDoc.GetNodes();
SwNodeIndex aStt( *pNds, nStartIdx );
SwCntntNode* pCNode = aStt.GetNode().GetCntntNode();
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 2cf1ca325a5b..a110e4003263 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -79,7 +79,7 @@ using namespace com::sun::star;
static SwCntntNode* GetCntntNode(SwDoc* pDoc, SwNodeIndex& rIdx, BOOL bNext)
{
- SwCntntNode* pCNd = pDoc->GetNodes()[ rIdx ]->GetCntntNode();
+ SwCntntNode * pCNd = rIdx.GetNode().GetCntntNode();
if(!pCNd && 0 == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx)
: pDoc->GetNodes().GoPrevious(&rIdx)))
{
@@ -368,12 +368,12 @@ static void MakeBookRegionOrPoint(SwFltStackEntry* pEntry, SwDoc* pDoc,
SwPaM& rRegion, BOOL bCheck )
{
if (pEntry->MakeRegion(pDoc, rRegion, bCheck )){
- const SwNodes& rNds = pDoc->GetNodes();
// BOOL b1 = rNds[rRegion.GetPoint()->nNode]->FindTableNode() != 0;
// const SwStartNode* p1 = rNds[rRegion.GetPoint()->nNode]->FindTableBoxStartNode();
// const SwStartNode* p2 = rNds[rRegion.GetMark()->nNode]->FindTableBoxStartNode();
- if( rNds[rRegion.GetPoint()->nNode]->FindTableBoxStartNode()
- != rNds[rRegion.GetMark()->nNode]->FindTableBoxStartNode() ){
+ if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode()
+ != rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode())
+ {
rRegion.Exchange(); // Ungueltiger Bereich
rRegion.DeleteMark(); // -> beide auf Mark
}
@@ -632,7 +632,7 @@ const SfxPoolItem* SwFltControlStack::GetFmtAttr(const SwPosition& rPos, USHORT
// im Stack ist das Attribut nicht vorhanden, also befrage das Dokument
// SwCntntNode * pNd = rPaM.GetCntntNode();
- SwCntntNode * pNd = pDoc->GetNodes()[ rPos.nNode ]->GetCntntNode();
+ SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
if (!pNd) // kein ContentNode, dann das dflt. Attribut
return &pDoc->GetAttrPool().GetDefaultItem(nWhich);
@@ -1205,8 +1205,7 @@ const SfxPoolItem& SwFltFormatCollection::GetAttr(USHORT nWhich)
const SfxPoolItem& SwFltOutDoc::GetNodeOrStyAttr(USHORT nWhich)
{
- SwCntntNode * pNd = GetDoc().GetNodes()[ pPaM->GetPoint()->nNode ]
- ->GetCntntNode();
+ SwCntntNode * pNd = pPaM->GetPoint()->nNode.GetNode().GetCntntNode();
if (pNd) // ContentNode: Attribut mit Parent
return pNd->GetAttr(nWhich);
else // kein ContentNode, dann das dflt. Attribut
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0a6151b98388..0ab613730948 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -32,7 +32,7 @@
#include "wrtww8.hxx"
#include "ww8par.hxx"
-#include <oox/core/tokens.hxx>
+#include <oox/token/tokens.hxx>
#include <oox/export/drawingml.hxx>
#include <oox/export/utils.hxx>
#include <oox/export/vmlexport.hxx>
@@ -128,6 +128,7 @@ using rtl::OUString;
using rtl::OUStringBuffer;
using rtl::OUStringToOString;
+using namespace oox;
using namespace docx;
using namespace sax_fastparser;
using namespace nsSwDocInfoSubType;
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 35c126cd6571..a4b5fb3a9514 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
-#include <oox/core/tokens.hxx>
+#include <oox/token/tokens.hxx>
#include <oox/export/drawingml.hxx>
#include <oox/export/vmlexport.hxx>
@@ -62,6 +62,7 @@
using namespace ::comphelper;
using namespace ::com::sun::star;
+using namespace ::oox;
using oox::vml::VMLExport;
diff --git a/sw/source/filter/ww8/docxfootnotes.hxx b/sw/source/filter/ww8/docxfootnotes.hxx
index b9d49f78f560..ec91731bc6dd 100644
--- a/sw/source/filter/ww8/docxfootnotes.hxx
+++ b/sw/source/filter/ww8/docxfootnotes.hxx
@@ -30,7 +30,6 @@
#include <fmtftn.hxx>
-#include <oox/core/tokens.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <sax/fshelper.hxx>
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index 7d8bc56272b7..9ae2cf4ce442 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -219,7 +219,7 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile )
if ( 0 != (nStrings = static_cast< USHORT >(aStrings.size())))
{
- SfxObjectShellRef xDocSh(new SwDocShell(SFX_CREATE_MODE_INTERNAL));
+ SfxObjectShellLock xDocSh(new SwDocShell(SFX_CREATE_MODE_INTERNAL));
if (xDocSh->DoInitNew(0))
{
SwDoc *pD = ((SwDocShell*)(&xDocSh))->GetDoc();
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 21804b38dca9..e1a0fbc1f5b1 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1007,7 +1007,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos,
const SfxPoolItem *pItem = GetStackAttr(rPos, nWhich);
if (!pItem)
{
- const SwCntntNode *pNd = pDoc->GetNodes()[ rPos.nNode ]->GetCntntNode();
+ SwCntntNode const*const pNd = rPos.nNode.GetNode().GetCntntNode();
if (!pNd)
pItem = &pDoc->GetAttrPool().GetDefaultItem(nWhich);
else
@@ -3609,8 +3609,7 @@ void wwSectionManager::InsertSegments()
}
const SwPosition* pPos = aSectPaM.GetPoint();
- const SwTxtNode* pSttNd =
- mrReader.rDoc.GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
const SwTableNode* pTableNd = pSttNd ? pSttNd->FindTableNode() : 0;
if (pTableNd)
{
@@ -4025,8 +4024,7 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
// evtl. Zeilen eingefuegt / aufgebrochen werden
//
const SwPosition* pPos = pPaM->GetPoint();
- const SwTxtNode* pSttNd =
- rDoc.GetNodes()[ pPos->nNode ]->GetTxtNode();
+ SwTxtNode const*const pSttNd = pPos->nNode.GetNode().GetTxtNode();
USHORT nCntPos = pPos->nContent.GetIndex();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index f848b6332c38..059f33634424 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2505,7 +2505,7 @@ void WW8TabDesc::CreateSwTable()
// ein Pagedesc steht. Dann wuerde der PageDesc in die naechste Zeile
// hinter der Tabelle rutschen, wo er nichts zu suchen hat. -> loeschen
// und spaeter an das Tabellenformat setzen
- if (SwTxtNode* pNd = pIo->rDoc.GetNodes()[pTmpPos->nNode]->GetTxtNode())
+ if (SwTxtNode *const pNd = pTmpPos->nNode.GetNode().GetTxtNode())
{
if (const SfxItemSet* pSet = pNd->GetpSwAttrSet())
{
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index 5645891c5b3c..05c30ce7b496 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -40,7 +40,7 @@
#include "xmlbrshe.hxx"
#include <editeng/tstpitem.hxx>
#include <editeng/brshitem.hxx>
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
#include <swmodule.hxx>
#include <doc.hxx>
#include "fmtornt.hxx"