diff options
Diffstat (limited to 'sw/source/core')
30 files changed, 309 insertions, 332 deletions
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 249500b95f98..c11092c5fd9d 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -34,9 +34,7 @@ #include <editeng/lrspitem.hxx> #include <editeng/adjitem.hxx> #include <editeng/brkitem.hxx> -#ifndef _SVX_SVDOBJ_HXX #include <svx/svdobj.hxx> -#endif #include <crsrsh.hxx> #include <doc.hxx> #include <pagefrm.hxx> @@ -719,7 +717,8 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField( (SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) ); - pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() ); + pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(), + pDoc->IsClipBoard() ); pTxtFld->ChgTxtNode( pTNd ); } diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index fcdcd99241f4..85ff12b699e6 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -33,26 +33,30 @@ #include <viscrs.hxx> #include <callnk.hxx> -BOOL SwCrsrShell::IsStartWord() const +BOOL SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const { - return pCurCrsr->IsStartWord(); + return pCurCrsr->IsStartWord( nWordType ); } -BOOL SwCrsrShell::IsEndWord() const + +BOOL SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const +{ + return pCurCrsr->IsEndWord( nWordType ); +} + +BOOL SwCrsrShell::IsInWord( sal_Int16 nWordType ) const { - return pCurCrsr->IsEndWord(); + return pCurCrsr->IsInWord( nWordType ); } + BOOL SwCrsrShell::IsStartSentence() const { return pCurCrsr->IsStartEndSentence( false ); } + BOOL SwCrsrShell::IsEndSentence() const { return pCurCrsr->IsStartEndSentence( true ); } -BOOL SwCrsrShell::IsInWord() const -{ - return pCurCrsr->IsInWord(); -} BOOL SwCrsrShell::GoStartWord() diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index aeaeeeb300bc..9fd6dd0516e9 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -144,7 +144,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, // Fuer das Ende merken wir uns die Ersetzungen und entferenen // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() || - !((SwTxtFld*)pHt)->GetFld().GetFld()->Expand().Len(); + !(static_cast<SwTxtFld const*>(pHt) + ->GetFld().GetFld()->ExpandField( + rNd.GetDoc()->IsClipBoard()).Len()); if ( bEmpty && nStart == nAkt ) { rArr.Insert( nAkt, rArr.Count() ); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index d8286d007395..5b381cbaaad2 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1141,19 +1141,19 @@ short SwCursor::MaxReplaceArived() } -BOOL SwCursor::IsStartWord() const +BOOL SwCursor::IsStartWord( sal_Int16 nWordType ) const { - return IsStartWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); + return IsStartWordWT( nWordType ); } -BOOL SwCursor::IsEndWord() const +BOOL SwCursor::IsEndWord( sal_Int16 nWordType ) const { - return IsEndWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); + return IsEndWordWT( nWordType ); } -BOOL SwCursor::IsInWord() const +BOOL SwCursor::IsInWord( sal_Int16 nWordType ) const { - return IsInWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); + return IsInWordWT( nWordType ); } BOOL SwCursor::GoStartWord() diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index a19ece4daf66..170193778421 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1480,6 +1480,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo ) pTmp->GetPoint()->nNode++; pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 ); } + // --> mst 2010-05-17 #i101009# + // prevent redlines that end on structural end node + if (& rDoc.GetNodes().GetEndOfContent() == + & pTmp->GetPoint()->nNode.GetNode()) + { + pTmp->GetPoint()->nNode--; + SwCntntNode *const pContentNode( pTmp->GetCntntNode() ); + pTmp->GetPoint()->nContent.Assign( pContentNode, + (pContentNode) ? pContentNode->Len() : 0 ); + } + // <-- rDoc.DeleteRedline( *pTmp, false, USHRT_MAX ); @@ -1499,6 +1510,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo ) pTmp->GetPoint()->nNode++; pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 ); } + // --> mst 2010-05-17 #i101009# + // prevent redlines that end on structural end node + if (& rDoc.GetNodes().GetEndOfContent() == + & pTmp->GetPoint()->nNode.GetNode()) + { + pTmp->GetPoint()->nNode--; + SwCntntNode *const pContentNode( pTmp->GetCntntNode() ); + pTmp->GetPoint()->nContent.Assign( pContentNode, + (pContentNode) ? pContentNode->Len() : 0 ); + } + // <-- } while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() )); SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_INSERT, nAuthor, aTimeStamp, aEmptyStr, 0, 0 ); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index c9ee5b00e181..31484ac303dd 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -1604,17 +1604,9 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam, } // <-- { - // dann eine Kopie vom Cursor erzeugen um alle Pams aus den - // anderen Sichten aus dem Loeschbereich zu verschieben - // ABER NICHT SICH SELBST !! - SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() ); - ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() ); - - const bool bSuccess( DeleteRangeImpl( aDelPam ) ); + bool const bSuccess( DeleteRangeImpl( rPam ) ); if (!bSuccess) return false; - - *rPam.GetPoint() = *aDelPam.GetPoint(); } if( bJoinTxt ) @@ -1625,7 +1617,24 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam, return true; } -bool SwDoc::DeleteRangeImpl( SwPaM & rPam, const bool ) +bool SwDoc::DeleteRangeImpl(SwPaM & rPam, const bool) +{ + // move all cursors out of the deleted range. + // but first copy the given PaM, because it could be a cursor that + // would be moved! + SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() ); + ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() ); + + bool const bSuccess( DeleteRangeImplImpl( aDelPam ) ); + if (bSuccess) + { // now copy position from temp copy to given PaM + *rPam.GetPoint() = *aDelPam.GetPoint(); + } + + return bSuccess; +} + +bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam) { SwPosition *pStt = (SwPosition*)rPam.Start(), *pEnd = (SwPosition*)rPam.End(); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index ebac34bf3540..f4e80e9de52a 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1241,13 +1241,18 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize, // Eintrag in den HashTable eintragen // Eintrag vorhanden ? pFnd = Find( rName, ppHashTbl, rTblSize, &nPos ); + String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) + { // Eintrag in der HashTabelle aendern - ((_HashStr*)pFnd)->aSetStr = pFld->Expand(); + static_cast<_HashStr*>(pFnd)->aSetStr = value; + } else + { // neuen Eintrag einfuegen *(ppHashTbl + nPos ) = new _HashStr( rName, - pFld->Expand(), (_HashStr*)*(ppHashTbl + nPos)); + value, static_cast<_HashStr *>(*(ppHashTbl + nPos))); + } } break; } @@ -1413,13 +1418,18 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) // Eintrag vorhanden ? USHORT nPos; SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos ); + String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) + { // Eintrag in der HashTabelle aendern - ((_HashStr*)pFnd)->aSetStr = pFld->Expand(); + static_cast<_HashStr*>(pFnd)->aSetStr = value; + } else + { // neuen Eintrag einfuegen *(pHashStrTbl + nPos ) = new _HashStr( rName, - pFld->Expand(), (_HashStr*)*(pHashStrTbl + nPos)); + value, static_cast<_HashStr *>(*(pHashStrTbl + nPos))); + } } break; case RES_GETEXPFLD: @@ -2724,7 +2734,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, //pDstFld->ChangeFormat( rSrcFld.GetFormat() ); //pDstFld->SetLanguage( rSrcFld.GetLanguage() ); - SwField * pNewFld = rSrcFld.Copy(); + SwField * pNewFld = rSrcFld.CopyField(); pDstFmtFld->SetFld(pNewFld); switch( nFldWhich ) diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 71dc70106245..9997eabd79c3 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -914,17 +914,24 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) case POS_INSIDE: { - pNewRedl->PushData( *pRedl, FALSE ); if( *pRStt == *pStt ) { - pRedl->SetStart( *pEnd, pRStt ); - // neu einsortieren - pRedlineTbl->Remove( n ); - pRedlineTbl->Insert( pRedl, n ); - bDec = true; + // --> mst 2010-05-17 #i97421# + // redline w/out extent loops + if (*pStt != *pEnd) + // <-- + { + pNewRedl->PushData( *pRedl, FALSE ); + pRedl->SetStart( *pEnd, pRStt ); + // re-insert + pRedlineTbl->Remove( n ); + pRedlineTbl->Insert( pRedl, n ); + bDec = true; + } } else { + pNewRedl->PushData( *pRedl, FALSE ); if( *pREnd != *pEnd ) { pNew = new SwRedline( *pRedl ); diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index 2b2c809c3cb2..f627870932f9 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -54,6 +54,9 @@ SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing ) SwExtTextInput::~SwExtTextInput() { + SwDoc *const pDoc = GetDoc(); + if (pDoc->IsInDtor()) { return; /* #i58606# */ } + SwTxtNode* pTNd = GetPoint()->nNode.GetNode().GetTxtNode(); if( pTNd ) { @@ -69,7 +72,6 @@ SwExtTextInput::~SwExtTextInput() // damit Undo / Redlining usw. richtig funktioniert, // muss ueber die Doc-Schnittstellen gegangen werden !!! - SwDoc* pDoc = GetDoc(); if(eInputLanguage != LANGUAGE_DONTKNOW) { // --> FME 2005-02-11 #i41974# Only set language attribute diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index e762de8489e3..a3e28fc0e425 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -377,32 +377,12 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc ) return (USHORT)pPageFrm->Prt().Width(); } - // Sonst versuchen wir es ueber die ViewShell - USHORT nWidth = GetBrowseWidthByVisArea( rDoc ); - if( !nWidth ) - { - // Und wenn das auch nicht geht, gibt es noch die ActualSize an der - // DocShell. - if( rDoc.GetDocShell() && GetpApp() && GetpApp()->GetDefaultDevice() ) - { - // this case shouldn't happen because the filter always waits until - // a view has been created -/* - nWidth = (USHORT)Application::GetDefaultDevice() - ->PixelToLogic( rDoc.GetDocShell()->GetActualSize(), - MapMode( MAP_TWIP ) ).Width(); -*/ - ASSERT( nWidth, "No browse width available" ); - } -#ifdef DBG_UTIL - else - { - // und wenn das auch nicht klappt, gibt es zur Zeit keine Breite - ASSERT( nWidth, "No browse width available" ); - } -#endif - } - return nWidth; + // --> OD 2010-05-12 #i91658# + // Assertion removed which state that no browse width is available. + // Investigation reveals that all calls can handle the case that no browse + // width is provided. + return GetBrowseWidthByVisArea( rDoc ); + // <-- } USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm( @@ -1859,7 +1839,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc, // weil sond die Umschaltung von relativ nach absolut nicht funktioniert. if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) ) { - USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc ); + const USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc ); if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() ) nAbsAvail = nVisAreaWidth; } diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index df6c8dc8c9f2..cb804b102c0e 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -357,17 +357,19 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd ) 0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) && 0 != (pTblNd = pANd->FindTableNode()) ) { - BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize(); + const BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize(); SwHTMLTableLayout *pLayout = pTblNd->GetTable().GetHTMLTableLayout(); if( pLayout ) { - USHORT nBrowseWidth = - pLayout->GetBrowseWidthByTable( *pDoc ); - if( nBrowseWidth ) + const USHORT nBrowseWidth = + pLayout->GetBrowseWidthByTable( *pDoc ); + if ( nBrowseWidth ) + { pLayout->Resize( nBrowseWidth, TRUE, TRUE, bLastGrf ? HTMLTABLE_RESIZE_NOW : 500 ); + } } } } diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 37ba5e5ced31..31c4a7dfea3e 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -457,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, const SwField* const pFld = pAttr->GetFld().GetFld(); if (pFld) { - sExp += pFld->Expand(); + sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard()); } } } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index a919da9a6515..1e4f699fa203 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -42,9 +42,7 @@ #include <expfld.hxx> #include <flddat.hxx> #include <swundo.hxx> -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <swddetbl.hxx> #include <hints.hxx> @@ -226,7 +224,8 @@ void SwEditShell::FieldToText( SwFieldType* pType ) *pFmtFld->GetTxtFld()->GetStart() ); // Feldinhalt durch Text ersetzen - String aEntry( pFmtFld->GetFld()->Expand() ); + String const aEntry( + pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) ); pPaM->SetMark(); pPaM->Move( fnMoveForward ); GetDoc()->DeleteRange( *pPaM ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 7af79fde80a8..32ab9fa07e94 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1162,8 +1162,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) void SwEditShell::TransliterateText( sal_uInt32 nType ) { - utl::TransliterationWrapper aTrans( - ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); StartAllAction(); SET_CURR_SHELL( this ); @@ -1185,6 +1184,32 @@ void SwEditShell::TransliterateText( sal_uInt32 nType ) EndAllAction(); } +void SwEditShell::TransliterateText( const String& rModuleName ) +{ + utl::TransliterationWrapper aTrans(::comphelper::getProcessServiceFactory(), 0 ); + aTrans.loadModuleByImplName( rModuleName, LANGUAGE_SYSTEM ); + StartAllAction(); + SET_CURR_SHELL( this ); + + SwPaM* pCrsr = GetCrsr(); + if( pCrsr->GetNext() != pCrsr ) + { + GetDoc()->StartUndo(UNDO_EMPTY, NULL); + FOREACHPAM_START( this ) + + if( PCURCRSR->HasMark() ) + GetDoc()->TransliterateText( *PCURCRSR, aTrans ); + + FOREACHPAM_END() + GetDoc()->EndUndo(UNDO_EMPTY, NULL); + } + else + GetDoc()->TransliterateText( *pCrsr, aTrans ); + + EndAllAction(); +} + + void SwEditShell::CountWords( SwDocStat& rStat ) const { FOREACHPAM_START( this ) diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index aa46869bca1a..182ed12d6ddd 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -203,7 +203,8 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const break; default: - nRet = rCalcPara.rCalc.Calculate( pFld->Expand() ).GetDouble(); + String const value(pFld->ExpandField(pDoc->IsClipBoard())); + nRet = rCalcPara.rCalc.Calculate(value).GetDouble(); } } else diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index ec65d0644bba..c47bd63e70ad 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -437,6 +437,23 @@ BOOL SwField::IsFixed() const return bRet; } +String SwField::ExpandField(bool const bInClipboard) const +{ + if (!bInClipboard) // #i85766# do not expand fields in clipboard documents + { + m_Cache = Expand(); + } + return m_Cache; +} + +SwField * SwField::CopyField() const +{ + SwField *const pNew = Copy(); + // #i85766# cache expansion of source (for clipboard) + pNew->m_Cache = Expand(); + return pNew; +} + /*-------------------------------------------------------------------- Beschreibung: Numerierung expandieren --------------------------------------------------------------------*/ diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 552555e925f9..e1560a230d7a 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -250,10 +250,6 @@ class SwFrm: public SwClient friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL ); friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow ); - //Checkt ob sich beim MakePos die Pos des Frm aendert oder nicht - //layact.cxx - friend BOOL CheckPos( SwFrm *pFrm ); - #if OSL_DEBUG_LEVEL > 1 //entfernt leere SwSectionFrms aus einer Kette friend SwFrm* SwClearDummies( SwFrm* pFrm ); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 1475a3909220..b51b2efc0a51 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1670,24 +1670,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) } // OD 31.10.2002 #104100# -// NOTE: no adjustments for vertical layout support necessary -BOOL CheckPos( SwFrm *pFrm ) -{ - if ( !pFrm->GetValidPosFlag() ) - { - Point aOld( pFrm->Frm().Pos() ); - pFrm->MakePos(); - if ( aOld != pFrm->Frm().Pos() ) - { - pFrm->Frm().Pos( aOld ); - pFrm->_InvalidatePos(); - return FALSE; - } - } - return TRUE; -} - -// OD 31.10.2002 #104100# // Implement vertical layout support BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect ) { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index f912be5cb9b1..b747c4e7aaff 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1680,62 +1680,6 @@ BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm, return bRet; } -void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab ) -{ - SWRECTFN( pTab ) - if ( !pTab->IsFollow() && !pTab->GetTable()->IsTblComplex() ) - { - SwLayoutFrm* pRow = (SwLayoutFrm*)pTab->Lower(); - // --> FME 2006-07-17 #134526# TabFrm without a lower? Better we check - // it before crashing. However, I still don't know how this can happen! - while ( pRow ) - { - SwLayoutFrm *pCell = (SwLayoutFrm*)pRow->Lower(); - SwFrm *pCnt = pCell->Lower(); - // --> OD 2006-11-08 #i70641# - make code robust - if ( pCnt ) - { - pCnt->Calc(); - const long nCellHeight = (pCell->Frm().*fnRect->fnGetHeight)(); - const long nCellY = (pCell->Frm().*fnRect->fnGetTop)()-1; - const long nCntHeight = (pCnt->Frm().*fnRect->fnGetHeight)(); - const long nCntY = (pCnt->Frm().*fnRect->fnGetTop)()-1; - if ( 0 != (pCell = (SwLayoutFrm*)pCell->GetNext()) ) - { - do - { - (pCell->Frm().*fnRect->fnSetTopAndHeight)( nCellY, nCellHeight ); - (pCell->Prt().*fnRect->fnSetHeight)( nCellHeight ); - pCell->_InvalidateAll(); - - pCnt = pCell->Lower(); - if ( pCnt ) - { - (pCnt->Frm().*fnRect->fnSetTopAndHeight)(nCntY, nCntHeight); - (pCnt->Prt().*fnRect->fnSetHeight)( nCntHeight ); - pCnt->_InvalidateAll(); - } - - pCell = (SwLayoutFrm*)pCell->GetNext(); - } while ( pCell ); - } - - SwTwips nRowTop = (pRow->Frm().*fnRect->fnGetTop)(); - SwTwips nUpBot = (pTab->GetUpper()->Frm().*fnRect->fnGetBottom)(); - if( (*fnRect->fnYDiff)( nUpBot, nRowTop ) < 0 ) - break; - } - // <-- - pRow = (SwLayoutFrm*)pRow->GetNext(); - } - } - SwFrm *pUp = pTab->GetUpper(); - long nBottom = (pUp->*fnRect->fnGetPrtBottom)(); - if ( pTab->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) - nBottom += pUp->Grow( LONG_MAX, TRUE ); - lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), pTab, LONG_MAX, false ); -} - void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom ) { // --> OD 2004-10-05 #i26945# - For correct appliance of the 'straightforward @@ -2146,17 +2090,13 @@ void SwTabFrm::MakeAll() if ( !bValidSize || !bValidPrtArea ) { - // HB #i101593# no optimization as it leeds to not layouting certain nested tables - // const BOOL bOptLower = (Frm().*fnRect->fnGetHeight)() == 0; - const BOOL bOptLower = FALSE; - const long nOldPrtWidth = (Prt().*fnRect->fnGetWidth)(); const long nOldFrmWidth = (Frm().*fnRect->fnGetWidth)(); const Point aOldPrtPos = (Prt().*fnRect->fnGetPos)(); Format( pAttrs ); SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout(); - if ( /*!bOptLower &&*/ pLayout && + if ( pLayout && ((Prt().*fnRect->fnGetWidth)() != nOldPrtWidth || (Frm().*fnRect->fnGetWidth)() != nOldFrmWidth) ) { @@ -2167,100 +2107,8 @@ void SwTabFrm::MakeAll() pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this ); pAttrs = pAccess->Get(); } - if ( !bOptLower && aOldPrtPos != (Prt().*fnRect->fnGetPos)() ) + if ( aOldPrtPos != (Prt().*fnRect->fnGetPos)() ) aNotify.SetLowersComplete( FALSE ); - - if ( bOptLower && Lower() ) - { - //MA 24. May. 95: Optimierungsversuch! - //Ganz nigel nagel neu das Teil. Damit wir nicht n-fach - //MakeAll'en formatieren wir flugs den Inhalt. - //Das erste Format mussten wir allerdings abwarten, damit - //die Breiten Stimmen! - //MA: Fix, Kein Calc wenn evtl. noch Seitengebunde Flys - //an den Cntnt haengen (siehe frmtool.cxx, ~SwCntntNotify). - SwDoc *pDoc = GetFmt()->GetDoc(); - if ( !pDoc->GetSpzFrmFmts()->Count() || - pDoc->IsLoaded() || pDoc->IsNewDoc() ) - { - //MA 28. Nov. 95: Und wieder ein Trick, gleich mal sehen - //ob ein Rueckfluss lohnt. - if ( bMoveable && !GetPrev() ) - { - GetLeaf( MAKEPAGE_NONE, FALSE ); //setzt das BackMoveJump - if ( SwFlowFrm::IsMoveBwdJump() ) - { - BOOL bDummy; - SwFtnBossFrm *pOldBoss = bFtnsInDoc ? - FindFtnBossFrm( TRUE ) : 0; - const BOOL bOldPrev = GetPrev() != 0; - if ( MoveBwd( bDummy ) ) - { - SWREFRESHFN( this ) - bMovedBwd = TRUE; - if ( bFtnsInDoc ) - MoveLowerFtns( 0, pOldBoss, 0, TRUE ); - - long nOldTop = (Frm().*fnRect->fnGetTop)(); - MakePos(); - if( nOldTop != (Frm().*fnRect->fnGetTop)() ) - { - SwHTMLTableLayout *pHTMLLayout = - GetTable()->GetHTMLTableLayout(); - if( pHTMLLayout ) - { - delete pAccess; - bCalcLowers |= pHTMLLayout->Resize( - pHTMLLayout->GetBrowseWidthByTabFrm( - *this ), FALSE ); - pAccess= new SwBorderAttrAccess( - SwFrm::GetCache(), this ); - pAttrs = pAccess->Get(); - } - } - - if ( bOldPrev != (0 != GetPrev()) ) - { - //Abstand nicht vergessen! - bValidPrtArea = FALSE; - Format( pAttrs ); - } - if ( bKeep && KEEPTAB ) - { - // --> OD 2005-09-28 #b6329202# - // Consider case that table is inside another - // table, because it has to be avoided, that - // superior table is formatted. - // Thus, find next content, table or section - // and, if a section is found, get its first - // content. -// SwFrm *pNxt = FindNextCnt(); -// // FindNextCnt geht ggf. in einen Bereich -// // hinein, in eine Tabelle allerdings auch -// if( pNxt && pNxt->IsInTab() ) -// pNxt = pNxt->FindTabFrm(); -// if ( pNxt ) -// { -// pNxt->Calc(); -// if ( !GetNext() ) -// bValidPos = FALSE; -// } - if ( 0 != lcl_FormatNextCntntForKeep( this ) && - !GetNext() ) - { - bValidPos = FALSE; - } - // <-- - } - } - } - } - ::lcl_FirstTabCalc( this ); - bValidSize = bValidPrtArea = FALSE; - Format( pAttrs ); - aNotify.SetLowersComplete( TRUE ); - } - } } //Wenn ich der erste einer Kette bin koennte ich mal sehen ob diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 438f7c246287..34c0a9843986 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -57,6 +57,9 @@ #include "pordrop.hxx" #include "crstate.hxx" // SwCrsrMoveState #include <pormulti.hxx> // SwMultiPortion +// --> OD 2010-05-05 #i111284# +#include <numrule.hxx> +// <-- // Nicht reentrant !!! // wird in GetCharRect gesetzt und im UnitUp/Down ausgewertet. @@ -143,6 +146,27 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig, } } +// --> OD 2010-05-05 #i111284# +namespace { + bool AreListLevelIndentsApplicableAndLabelAlignmentActive( const SwTxtNode& rTxtNode ) + { + bool bRet( false ); + + if ( rTxtNode.AreListLevelIndentsApplicable() ) + { + const SwNumFmt& rNumFmt = + rTxtNode.GetNumRule()->Get( static_cast<USHORT>(rTxtNode.GetActualListLevel()) ); + if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) + { + bRet = true; + } + } + + return bRet; + } +} // end of anonymous namespace +// <-- + /************************************************************************* * SwTxtMargin::CtorInitTxtMargin() *************************************************************************/ @@ -156,7 +180,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace(); // --> OD 2009-09-08 #i95907#, #b6879723# - const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable(); + // --> OD 2010-05-05 #i111284# + const bool bListLevelIndentsApplicableAndLabelAlignmentActive( + AreListLevelIndentsApplicableAndLabelAlignmentActive( *(pFrm->GetTxtNode()) ) ); // <-- // @@ -181,9 +207,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) nLMWithNum - pNode->GetLeftMarginWithNum( sal_False ) - // --> OD 2009-09-08 #i95907#, #b6879723# + // --> OD 2010-05-05 #i111284# // rSpace.GetLeft() + // rSpace.GetTxtLeft(); - ( bListLevelIndentsApplicable + ( bListLevelIndentsApplicableAndLabelAlignmentActive ? 0 : ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) ); // <-- @@ -191,8 +218,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else { // --> OD 2009-09-08 #i95907#, #b6879723# + // --> OD 2010-05-05 #i111284# // if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) - if ( bListLevelIndentsApplicable || + if ( bListLevelIndentsApplicableAndLabelAlignmentActive || !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) // <-- { @@ -202,9 +230,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) nLMWithNum - pNode->GetLeftMarginWithNum( sal_False ) - // --> OD 2009-09-08 #i95907#, #b6879723# + // --> OD 2010-05-05 #i111284# // rSpace.GetLeft() + // rSpace.GetTxtLeft(); - ( bListLevelIndentsApplicable + ( bListLevelIndentsApplicableAndLabelAlignmentActive ? 0 : ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) ); // <-- @@ -292,10 +321,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) nFirstLineOfs = nFLOfst; // --> OD 2009-09-08 #i95907#, #b6879723# + // --> OD 2010-05-05 #i111284# // if ( pFrm->IsRightToLeft() || // !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) if ( pFrm->IsRightToLeft() || - bListLevelIndentsApplicable || + bListLevelIndentsApplicableAndLabelAlignmentActive || !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ) // <-- { diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 5cfffeaf5229..61f873b010b7 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -870,8 +870,9 @@ USHORT SwTOXAuthority::GetLevel() const -----------------------------------------------------------------------*/ void SwTOXAuthority::_GetText( String& rTxt, String& ) { - // - rTxt = m_rField.GetFld()->Expand(); + bool const isClipBoard( + m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard()); + rTxt = m_rField.GetFld()->ExpandField(isClipBoard); } /* -----------------21.09.99 12:50------------------- diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 4ad6c773db1d..6b1adc76fbec 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -32,6 +32,7 @@ #include <fmtfld.hxx> #include <txtfld.hxx> #include <docufld.hxx> +#include <doc.hxx> #include "reffld.hxx" #include "ddefld.hxx" @@ -68,7 +69,7 @@ SwFmtFld::SwFmtFld( const SwField &rFld ) SwClient( rFld.GetTyp() ), pTxtAttr( 0 ) { - pField = rFld.Copy(); + pField = rFld.CopyField(); } // #i24434# @@ -83,7 +84,7 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAttr ) if(rAttr.GetFld()) { rAttr.GetFld()->GetTyp()->Add(this); - pField = rAttr.GetFld()->Copy(); + pField = rAttr.GetFld()->CopyField(); } } @@ -258,9 +259,10 @@ BOOL SwFmtFld::IsProtect() const |* *************************************************************************/ -SwTxtFld::SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStartPos ) +SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos, + bool const bInClipboard) : SwTxtAttr( rAttr, nStartPos ) - , m_aExpand( rAttr.GetFld()->Expand() ) + , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) ) , m_pTxtNode( 0 ) { rAttr.pTxtAttr = this; @@ -292,7 +294,8 @@ void SwTxtFld::Expand() const ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" ); const SwField* pFld = GetFld().GetFld(); - XubString aNewExpand( pFld->Expand() ); + XubString aNewExpand( + pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) ); if( aNewExpand == m_aExpand ) { diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 7d6b8959787b..45f6c5da2baf 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -289,39 +289,45 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr ) } // Die Fussnoten duplizieren -void SwTxtFtn::CopyFtn( SwTxtFtn *pDest ) const +void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const { - if ( m_pStartNode && pDest->GetStartNode() ) + if (m_pStartNode && !rDest.GetStartNode()) { - // die Fussnoten koennen in unterschiedlichen Dokumenten stehen !! - SwDoc* pDstDoc = pDest->m_pTxtNode->GetDoc(); + // dest missing node section? create it here! + // (happens in SwTxtNode::CopyText if pDest == this) + rDest.MakeNewTextSection( rDestNode.GetNodes() ); + } + if (m_pStartNode && rDest.GetStartNode()) + { + // footnotes not necessarily in same document! + SwDoc *const pDstDoc = rDestNode.GetDoc(); SwNodes &rDstNodes = pDstDoc->GetNodes(); - // Wir kopieren nur den Inhalt der Sektion + // copy only the content of the section SwNodeRange aRg( *m_pStartNode, 1, *m_pStartNode->GetNode().EndOfSectionNode() ); - // Wir fuegen auf dem Ende von pDest ein, d.h. die Nodes - // werden angehaengt. nDestLen haelt die Anzahl der CntNodes - // in pDest _vor_ dem Kopieren. - SwNodeIndex aStart( *(pDest->GetStartNode()) ); + // insert at the end of rDest, i.e., the nodes are appended. + // nDestLen contains number of CntntNodes in rDest _before_ copy. + SwNodeIndex aStart( *(rDest.GetStartNode()) ); SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() ); ULONG nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1; m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE ); - // Wenn die Dest-Sektion nicht leer war, so muessen die alten - // Nodes geloescht werden: - // Vorher: Src: SxxxE, Dst: SnE - // Nachher: Src: SxxxE, Dst: SnxxxE - // und Src: SxxxE, Dst: SxxxE + // in case the destination section was not empty, delete the old nodes + // before: Src: SxxxE, Dst: SnE + // now: Src: SxxxE, Dst: SnxxxE + // after: Src: SxxxE, Dst: SxxxE aStart++; rDstNodes.Delete( aStart, nDestLen ); } - // Der benutzerdefinierte String muss auch uebertragen werden. + // also copy user defined number string if( GetFtn().aNumber.Len() ) - ((SwFmtFtn&)pDest->GetFtn()).aNumber = GetFtn().aNumber; + { + const_cast<SwFmtFtn &>(rDest.GetFtn()).aNumber = GetFtn().aNumber; + } } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 798d7e41602f..76560bae91d7 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1327,11 +1327,11 @@ void lcl_CopyHint( const USHORT nWhich, const SwTxtAttr * const pHt, ASSERT( nWhich == pHt->Which(), "Falsche Hint-Id" ); switch( nWhich ) { - // Wenn wir es mit einem Fussnoten-Attribut zu tun haben, - // muessen wir natuerlich auch den Fussnotenbereich kopieren. + // copy nodesarray section with footnote content case RES_TXTATR_FTN : + ASSERT(pDest, "lcl_CopyHint: no destination text node?"); static_cast<const SwTxtFtn*>(pHt)->CopyFtn( - static_cast<SwTxtFtn*>(pNewHt)); + *static_cast<SwTxtFtn*>(pNewHt), *pDest); break; // Beim Kopieren von Feldern in andere Dokumente @@ -1535,6 +1535,13 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, xub_StrLen nTxtStartIdx = rStart.GetIndex(); xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken + if (pDest->GetDoc()->IsClipBoard() && this->GetNum()) + { + // #i111677# cache expansion of source (for clipboard) + pDest->m_pNumStringCache.reset( + new ::rtl::OUString(this->GetNumString())); + } + if( !nLen ) { // wurde keine Laenge angegeben, dann Kopiere die Attribute @@ -1637,6 +1644,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, // Del-Array fuer alle RefMarks ohne Ausdehnung SwpHts aRefMrkArr; + USHORT nDeletedDummyChars(0); //Achtung: kann ungueltig sein!! for (USHORT n = 0; ( n < nSize ); ++n) { @@ -1708,31 +1716,24 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(), nAttrStt, nAttrEnd ); -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -//JP 23.04.95: erstmal so gesondert hier behandeln. Am Besten ist es -// aber im CopyFtn wenn die pDestFtn keinen StartNode hat, -// sich diesen dann anlegt. -// Aber so kurz vor der BETA besser nicht anfassen. - if( RES_TXTATR_FTN == nWhich ) - { - SwTxtFtn* pFtn = (SwTxtFtn*)pNewHt; - pFtn->ChgTxtNode( this ); - pFtn->MakeNewTextSection( GetNodes() ); - lcl_CopyHint( nWhich, pHt, pFtn, 0, 0 ); - pFtn->ChgTxtNode( 0 ); - } - else -//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - { - lcl_CopyHint( nWhich, pHt, pNewHt, 0, pDest ); - } + lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest); aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() ); } else { - pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt, - nAttrEnd, nsSetAttrMode::SETATTR_NOTXTATRCHR ); - lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest ); + pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars, + nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR ); + if (pNewHt) + { + lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest ); + } + else if (pHt->HasDummyChar()) + { + // The attribute that has failed to be copied would insert + // dummy char, so positions of the following attributes have + // to be shifted by one to compensate for that missing char. + ++nDeletedDummyChars; + } } if( RES_TXTATR_REFMARK == nWhich && !pEndIdx && !bCopyRefMark ) @@ -2826,6 +2827,11 @@ BOOL SwTxtNode::HasBullet() const //i53420 added max outline parameter XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const { + if (GetDoc()->IsClipBoard() && m_pNumStringCache.get()) + { + // #i111677# do not expand number strings in clipboard documents + return *m_pNumStringCache; + } const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; if ( pRule && IsCountedInList() && @@ -3049,8 +3055,10 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt, rTxt.Erase( nPos, 1 ); if( bExpandFlds ) { - const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld(). - GetFld()->Expand() ); + const XubString aExpand( + static_cast<SwTxtFld const*>(pAttr)->GetFld() + .GetFld()->ExpandField( + GetDoc()->IsClipBoard())); rTxt.Insert( aExpand, nPos ); nPos = nPos + aExpand.Len(); nEndPos = nEndPos + aExpand.Len(); @@ -3197,7 +3205,9 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, { case RES_TXTATR_FIELD: { - const XubString aExpand( ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand() ); + XubString const aExpand( + static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld() + ->ExpandField(GetDoc()->IsClipBoard())); if( aExpand.Len() ) { aDestIdx++; // dahinter einfuegen; @@ -3293,7 +3303,9 @@ const ModelToViewHelper::ConversionMap* const SwTxtAttr* pAttr = (*pSwpHints2)[i]; if ( RES_TXTATR_FIELD == pAttr->Which() ) { - const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().GetFld()->Expand() ); + const XubString aExpand( + static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld() + ->ExpandField(GetDoc()->IsClipBoard())); if ( aExpand.Len() > 0 ) { const xub_StrLen nFieldPos = *pAttr->GetStart(); @@ -4435,6 +4447,10 @@ namespace { if ( pNumRuleItem.GetValue().Len() > 0 ) { mbAddTxtNodeToList = true; + // --> OD 2010-05-12 #i105562# + // + mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr(); + // <-- } } break; @@ -4446,10 +4462,6 @@ namespace { dynamic_cast<const SfxStringItem&>(pItem); ASSERT( pListIdItem.GetValue().Len() > 0, "<HandleSetAttrAtTxtNode(..)> - empty list id attribute not excepted. Serious defect -> please inform OD." ); -// const SfxStringItem& rListIdItemOfTxtNode = -// dynamic_cast<const SfxStringItem&>( -// rTxtNode.GetAttr( RES_PARATR_LIST_ID )); -// if ( pListIdItem.GetValue() != rListIdItemOfTxtNode.GetValue() ) const String sListIdOfTxtNode = rTxtNode.GetListId(); if ( pListIdItem.GetValue() != sListIdOfTxtNode ) { @@ -4563,11 +4575,6 @@ namespace { { const SfxStringItem* pListIdItem = dynamic_cast<const SfxStringItem*>(pItem); -// const SfxStringItem& rListIdItemOfTxtNode = -// dynamic_cast<const SfxStringItem&>( -// mrTxtNode.GetAttr( RES_PARATR_LIST_ID )); -// if ( pListIdItem && -// pListIdItem->GetValue() != rListIdItemOfTxtNode.GetValue() ) const String sListIdOfTxtNode = mrTxtNode.GetListId(); if ( pListIdItem && pListIdItem->GetValue() != sListIdOfTxtNode ) @@ -4972,7 +4979,9 @@ namespace { mrTxtNode.AddToList(); } // --> OD 2008-11-19 #i70748# - else if ( dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 ) + // --> OD 2010-05-12 #i105562# + else if ( mrTxtNode.GetpSwAttrSet() && + dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 ) { mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr(); } diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index ff2a40cdd9eb..ac2f281b0d90 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1043,7 +1043,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd ); break; case RES_TXTATR_FIELD: - pNew = new SwTxtFld( (SwFmtFld&)rNew, nStt ); + pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt, + rDoc.IsClipBoard() ); break; case RES_TXTATR_FLYCNT: { diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx index fe189d5adf50..8a3c6c507c93 100644 --- a/sw/source/core/undo/SwUndoField.cxx +++ b/sw/source/core/undo/SwUndoField.cxx @@ -63,12 +63,14 @@ SwPosition SwUndoField::GetPosition() } SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos, - const SwField & _aOldField, - const SwField & _aNewField, + const SwField & rOldField, + const SwField & rNewField, SwMsgPoolItem * _pHnt, BOOL _bUpdate, SwUndoId _nId) - : SwUndoField(rPos,_nId), pOldField(_aOldField.Copy()), - pNewField(_aNewField.Copy()), pHnt(_pHnt), - bUpdate(_bUpdate) + : SwUndoField(rPos,_nId) + , pOldField(rOldField.CopyField()) + , pNewField(rNewField.CopyField()) + , pHnt(_pHnt) + , bUpdate(_bUpdate) { ASSERT(pOldField, "No old field!"); ASSERT(pNewField, "No new field!"); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 347a70190006..ef39a4e18950 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -868,7 +868,15 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter ) SetPaM( rPam ); if( pRedlSaveData ) - rDoc.DeleteRedline( rPam, false, USHRT_MAX ); + { + bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE); + OSL_ENSURE(bSuccess, + "SwUndoDelete::Redo: used to have redline data, but now none?"); + if (!bSuccess) + { + delete pRedlSaveData, pRedlSaveData = 0; + } + } if( !bDelFullPara ) { diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 2c341cb53bf5..1a71a705b2fb 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1120,7 +1120,12 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam ) if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) ) rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED)); // - rDoc.AppendRedline( pRedl, true ); +#if OSL_DEBUG_LEVEL > 0 + bool const bSuccess = +#endif + rDoc.AppendRedline( pRedl, true ); + OSL_ENSURE(bSuccess, + "SwRedlineSaveData::RedlineToDoc: insert redline failed"); rDoc.SetRedlineMode_intern( eOld ); } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 44991960ac25..d0d74fa023c7 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -78,7 +78,9 @@ public: , m_rThis(rThis) , m_bIsEndnote(bIsEndnote) , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) - , m_bIsDescriptor(0 == pFootnote) +// #i111177#: unxsols4 (Sun C++ 5.9 SunOS_sparc) generates wrong code for this +// , m_bIsDescriptor(0 == pFootnote) + , m_bIsDescriptor((0 == pFootnote) ? true : false) , m_pFmtFtn(pFootnote) { } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 980306be3aec..ab486b71ed04 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1659,9 +1659,14 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex( aPropertyValues.Insert(pData, aPropertyValues.Count()); } Size aSize = rFmt.GetGraphicSize(); - aSize.Width() = TWIP_TO_MM100( aSize.Width() ); - aSize.Height() = TWIP_TO_MM100( aSize.Height() ); - pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0)); + // --> OD 2010-05-04 #i101131# - applying patch from CMC + // adjust conversion due to type mismatch between <Size> and <awt::Size> +// aSize.Width() = TWIP_TO_MM100( aSize.Width() ); +// aSize.Height() = TWIP_TO_MM100( aSize.Height() ); +// pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0)); + awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height())); + pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0)); + // <-- aPropertyValues.Insert(pData, aPropertyValues.Count()); const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation(); |