openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1555112 [13/18] - in /openoffice/branches/rejuvenate01: ./ main/ main/autodoc/source/parser_i/idoc/ main/dbaccess/source/shared/ main/helpcontent2/source/text/shared/01/ main/offapi/com/sun/star/accessibility/ main/offapi/com/sun/star/anim...
Date Fri, 03 Jan 2014 14:45:04 GMT
Modified: openoffice/branches/rejuvenate01/main/sw/source/core/docnode/ndcopy.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/docnode/ndcopy.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/docnode/ndcopy.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/docnode/ndcopy.cxx Fri Jan  3 14:44:44 2014
@@ -132,7 +132,9 @@ namespace
     }
 
     // TODO: use SaveBookmark (from _DelBookmarks)
-    static void lcl_CopyBookmarks(const SwPaM& rPam, SwPaM& rCpyPam)
+    static void lcl_CopyBookmarks(
+        const SwPaM& rPam,
+        SwPaM& rCpyPam )
     {
         const SwDoc* pSrcDoc = rPam.GetDoc();
         SwDoc* pDestDoc =  rCpyPam.GetDoc();
@@ -144,19 +146,23 @@ namespace
 
         typedef ::std::vector< const ::sw::mark::IMark* > mark_vector_t;
         mark_vector_t vMarksToCopy;
-        for(IDocumentMarkAccess::const_iterator_t ppMark = pSrcMarkAccess->getMarksBegin();
-            ppMark != pSrcMarkAccess->getMarksEnd();
-            ppMark++)
+        for ( IDocumentMarkAccess::const_iterator_t ppMark = pSrcMarkAccess->getAllMarksBegin();
+              ppMark != pSrcMarkAccess->getAllMarksEnd();
+              ppMark++ )
         {
             const ::sw::mark::IMark* const pMark = ppMark->get();
+
             const SwPosition& rMarkStart = pMark->GetMarkStart();
             const SwPosition& rMarkEnd = pMark->GetMarkEnd();
-            // only include marks that are in the range and not touching
-            // both start and end
-            bool bIsNotOnBoundary = pMark->IsExpanded()
+            // only include marks that are in the range and not touching both start and end
+            // - not for annotation marks.
+            const bool bIsNotOnBoundary =
+                pMark->IsExpanded()
                 ? (rMarkStart != rStt || rMarkEnd != rEnd)  // rMarkStart != rMarkEnd
                 : (rMarkStart != rStt && rMarkEnd != rEnd); // rMarkStart == rMarkEnd
-            if(rMarkStart >= rStt && rMarkEnd <= rEnd && bIsNotOnBoundary)
+            if ( rMarkStart >= rStt && rMarkEnd <= rEnd
+                 && ( bIsNotOnBoundary
+                      || IDocumentMarkAccess::GetType( *pMark ) == IDocumentMarkAccess::ANNOTATIONMARK ) )
             {
                 vMarksToCopy.push_back(pMark);
             }
@@ -1245,13 +1251,13 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPos
 			if( aInsPos == pEnd->nNode )
 			{
 				SwNodeIndex aSaveIdx( aInsPos, -1 );
-                CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, sal_False );
+                CopyWithFlyInFly( aRg, 0, aInsPos, &rPam, bMakeNewFrms, sal_False );
 				aSaveIdx++;
 				pEnd->nNode = aSaveIdx;
 				pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 );
 			}
 			else
-                CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, bMakeNewFrms, sal_False );
+                CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, &rPam, bMakeNewFrms, sal_False );
 
             bCopyBookmarks = false;
 
@@ -1281,7 +1287,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPos
 	aCpyPam.Exchange();
 
 	// dann kopiere noch alle Bookmarks
-    if( bCopyBookmarks && getIDocumentMarkAccess()->getMarksCount() )
+    if( bCopyBookmarks && getIDocumentMarkAccess()->getAllMarksCount() )
 		lcl_CopyBookmarks( rPam, aCpyPam );
 
 	if( nsRedlineMode_t::REDLINE_DELETE_REDLINES & eOld )
@@ -1318,22 +1324,27 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPos
 
 //  ----- Copy-Methode vom SwDoc - "kopiere Fly's in Fly's" ------
 
-void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
-							const SwNodeIndex& rInsPos, sal_Bool bMakeNewFrms,
-							sal_Bool bDelRedlines, sal_Bool bCopyFlyAtFly ) const
+void SwDoc::CopyWithFlyInFly(
+    const SwNodeRange& rRg,
+    const xub_StrLen nEndContentIndex,
+    const SwNodeIndex& rInsPos,
+    const SwPaM* pCopiedPaM,
+    const sal_Bool bMakeNewFrms,
+    const sal_Bool bDelRedlines,
+    const sal_Bool bCopyFlyAtFly ) const
 {
-	SwDoc* pDest = rInsPos.GetNode().GetDoc();
+    SwDoc* pDest = rInsPos.GetNode().GetDoc();
 
-	_SaveRedlEndPosForRestore aRedlRest( rInsPos, 0 );
+    _SaveRedlEndPosForRestore aRedlRest( rInsPos, 0 );
 
-	SwNodeIndex aSavePos( rInsPos, -1 );
-	sal_Bool bEndIsEqualEndPos = rInsPos == rRg.aEnd;
-	GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, sal_True );
-	aSavePos++;
-	if( bEndIsEqualEndPos )
-		((SwNodeIndex&)rRg.aEnd) = aSavePos;
+    SwNodeIndex aSavePos( rInsPos, -1 );
+    sal_Bool bEndIsEqualEndPos = rInsPos == rRg.aEnd;
+    GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, sal_True );
+    aSavePos++;
+    if( bEndIsEqualEndPos )
+        ((SwNodeIndex&)rRg.aEnd) = aSavePos;
 
-	aRedlRest.Restore();
+    aRedlRest.Restore();
 
 #ifdef DBG_UTIL
 	{
@@ -1359,21 +1370,23 @@ void SwDoc::CopyWithFlyInFly( const SwNo
         CopyFlyInFlyImpl( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
     }
 
-	SwNodeRange aCpyRange( aSavePos, rInsPos );
+    SwNodeRange aCpyRange( aSavePos, rInsPos );
 
-	// dann kopiere noch alle Bookmarks
-    if( getIDocumentMarkAccess()->getMarksCount() )
-	{
-		SwPaM aRgTmp( rRg.aStart, rRg.aEnd );
-		SwPaM aCpyTmp( aCpyRange.aStart, aCpyRange.aEnd );
+    // dann kopiere noch alle Bookmarks
+    if( getIDocumentMarkAccess()->getAllMarksCount() )
+    {
+        SwPaM aRgTmp( rRg.aStart, rRg.aEnd );
+        SwPaM aCpyTmp( aCpyRange.aStart, aCpyRange.aEnd );
 
-		lcl_CopyBookmarks( aRgTmp, aCpyTmp );
-	}
+        lcl_CopyBookmarks(
+            pCopiedPaM != NULL ? *pCopiedPaM : aRgTmp,
+            aCpyTmp );
+    }
 
-	if( bDelRedlines && ( nsRedlineMode_t::REDLINE_DELETE_REDLINES & pDest->GetRedlineMode() ))
-		lcl_DeleteRedlines( rRg, aCpyRange );
+    if( bDelRedlines && ( nsRedlineMode_t::REDLINE_DELETE_REDLINES & pDest->GetRedlineMode() ))
+        lcl_DeleteRedlines( rRg, aCpyRange );
 
-	pDest->GetNodes()._DelDummyNodes( aCpyRange );
+    pDest->GetNodes()._DelDummyNodes( aCpyRange );
 }
 
 void lcl_ChainFmts( SwFlyFrmFmt *pSrc, SwFlyFrmFmt *pDest )
@@ -1392,9 +1405,11 @@ void lcl_ChainFmts( SwFlyFrmFmt *pSrc, S
 	}
 }
 
-void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
-        const xub_StrLen nEndContentIndex, const SwNodeIndex& rStartIdx,
-        const bool bCopyFlyAtFly ) const
+void SwDoc::CopyFlyInFlyImpl(
+    const SwNodeRange& rRg,
+    const xub_StrLen nEndContentIndex,
+    const SwNodeIndex& rStartIdx,
+    const bool bCopyFlyAtFly ) const
 {
 	// Bug 22727: suche erst mal alle Flys zusammen, sortiere sie entsprechend
 	//			  ihrer Ordnungsnummer und kopiere sie erst dann. Damit wird

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/docnode/nodes.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/docnode/nodes.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/docnode/nodes.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/docnode/nodes.cxx Fri Jan  3 14:44:44 2014
@@ -291,19 +291,20 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
 
                     pTxtNd->AddToList();
 
-					// Sonderbehandlung fuer die Felder!
-					if( pHts && pHts->Count() )
+                    // Sonderbehandlung fuer die Felder!
+                    if( pHts && pHts->Count() )
                     {
                         // this looks fishy if pDestDoc != 0
                         bool const bToUndo = !pDestDoc &&
                             GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds);
-						for( sal_uInt16 i = pHts->Count(); i; )
-						{
-							sal_uInt16 nDelMsg = 0;
+                        for( sal_uInt16 i = pHts->Count(); i; )
+                        {
+                            sal_uInt16 nDelMsg = 0;
                             SwTxtAttr * const pAttr = pHts->GetTextHint( --i );
                             switch ( pAttr->Which() )
                             {
                             case RES_TXTATR_FIELD:
+                            case RES_TXTATR_ANNOTATION:
                             case RES_TXTATR_INPUTFIELD:
                                 {
                                     SwTxtFld* pTxtFld = static_cast<SwTxtFld*>(pAttr);
@@ -318,30 +319,31 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
                                                 ( pTxtFld->GetFmtFld().IsFldInDoc()
                                                   ? SWFMTFLD_INSERTED
                                                   : SWFMTFLD_REMOVED ) ) );
-									}
-									else
-									if( RES_DDEFLD == pTyp->Which() )
-									{
-										if( bToUndo )
-											((SwDDEFieldType*)pTyp)->DecRefCnt();
-										else
-											((SwDDEFieldType*)pTyp)->IncRefCnt();
-									}
-									nDelMsg = RES_FIELD_DELETED;
-								}
-								break;
-							case RES_TXTATR_FTN:
-								nDelMsg = RES_FOOTNOTE_DELETED;
-								break;
+                                    }
+                                    else
+                                        if( RES_DDEFLD == pTyp->Which() )
+                                        {
+                                            if( bToUndo )
+                                                ((SwDDEFieldType*)pTyp)->DecRefCnt();
+                                            else
+                                                ((SwDDEFieldType*)pTyp)->IncRefCnt();
+                                        }
+                                        nDelMsg = RES_FIELD_DELETED;
+                                }
+                                break;
 
-							case RES_TXTATR_TOXMARK:
+                            case RES_TXTATR_FTN:
+                                nDelMsg = RES_FOOTNOTE_DELETED;
+                                break;
+
+                            case RES_TXTATR_TOXMARK:
                                 static_cast<SwTOXMark&>(pAttr->GetAttr())
                                     .InvalidateTOXMark();
-								break;
+                                break;
 
-							case RES_TXTATR_REFMARK:
-								nDelMsg = RES_REFMARK_DELETED;
-								break;
+                            case RES_TXTATR_REFMARK:
+                                nDelMsg = RES_REFMARK_DELETED;
+                                break;
 
                             case RES_TXTATR_META:
                             case RES_TXTATR_METAFIELD:
@@ -356,37 +358,38 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
 
                             default:
                                 break;
-							}
-							if( nDelMsg && bToUndo )
-							{
-								SwPtrMsgPoolItem aMsgHint( nDelMsg,
-													(void*)&pAttr->GetAttr() );
-								rNds.GetDoc()->GetUnoCallBack()->
-											ModifyNotification( &aMsgHint, &aMsgHint );
-							}
-						}
-					}
-//FEATURE::CONDCOLL
-					if( RES_CONDTXTFMTCOLL == pTxtNd->GetTxtColl()->Which() )
-						pTxtNd->ChkCondColl();
-//FEATURE::CONDCOLL
-				}
-				else
-				{
-					// in unterschiedliche Docs gemoved ?
-					// dann die Daten wieder persistent machen
-					if( pCNd->IsNoTxtNode() && bRestPersData )
-						((SwNoTxtNode*)pCNd)->RestorePersistentData();
-				}
-			}
-		}
-	}
+                            }
+
+                            if( nDelMsg && bToUndo )
+                            {
+                                SwPtrMsgPoolItem aMsgHint( nDelMsg,
+                                    (void*)&pAttr->GetAttr() );
+                                rNds.GetDoc()->GetUnoCallBack()->
+                                    ModifyNotification( &aMsgHint, &aMsgHint );
+                            }
+                        }
+                    }
+                    //FEATURE::CONDCOLL
+                    if( RES_CONDTXTFMTCOLL == pTxtNd->GetTxtColl()->Which() )
+                        pTxtNd->ChkCondColl();
+                    //FEATURE::CONDCOLL
+                }
+                else
+                {
+                    // in unterschiedliche Docs gemoved ?
+                    // dann die Daten wieder persistent machen
+                    if( pCNd->IsNoTxtNode() && bRestPersData )
+                        ((SwNoTxtNode*)pCNd)->RestorePersistentData();
+                }
+            }
+        }
+    }
 
-	//JP 03.02.99: alle Felder als invalide erklaeren, aktu. erfolgt im
-	//				Idle-Handler des Docs
-	GetDoc()->SetFieldsDirty( true, NULL, 0 );
-	if( rNds.GetDoc() != GetDoc() )
-		rNds.GetDoc()->SetFieldsDirty( true, NULL, 0 );
+    //JP 03.02.99: alle Felder als invalide erklaeren, aktu. erfolgt im
+    //				Idle-Handler des Docs
+    GetDoc()->SetFieldsDirty( true, NULL, 0 );
+    if( rNds.GetDoc() != GetDoc() )
+        rNds.GetDoc()->SetFieldsDirty( true, NULL, 0 );
 
 
 	if( bNewFrms )

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/docnode/section.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/docnode/section.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/docnode/section.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/docnode/section.cxx Fri Jan  3 14:44:44 2014
@@ -1548,7 +1548,7 @@ void SwIntrnlSectRefLink::DataChanged( c
 
 					SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc );
 
-                    pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, bCreateFrm );
+                    pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, NULL, bCreateFrm );
 					aSave++;
 
 					if( !bCreateFrm )

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/edit/edfld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/edit/edfld.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/edit/edfld.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/edit/edfld.cxx Fri Jan  3 14:44:44 2014
@@ -316,6 +316,7 @@ void SwEditShell::UpdateFlds( SwField &r
 		sal_Bool bTblSelBreak = sal_False;
 
 		SwMsgPoolItem aFldHint( RES_TXTATR_FIELD );
+		SwMsgPoolItem aAnnotationFldHint( RES_TXTATR_ANNOTATION );
 		SwMsgPoolItem aInputFldHint( RES_TXTATR_INPUTFIELD );
 		FOREACHPAM_START(this)						// fuer jeden PaM
 			if( PCURCRSR->HasMark() && bOkay )		// ... mit Selektion
@@ -338,6 +339,7 @@ void SwEditShell::UpdateFlds( SwField &r
 				while(	bOkay
 					 && pCurStt->nContent != pCurEnd->nContent
 					 && ( aPam.Find( aFldHint, sal_False, fnMoveForward, &aCurPam )
+                          || aPam.Find( aAnnotationFldHint, sal_False, fnMoveForward, &aCurPam )
                           || aPam.Find( aInputFldHint, sal_False, fnMoveForward, &aCurPam ) ) )
 				{
 					//	wenn nur ein Pam mehr als ein Feld enthaelt ...

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/edit/edlingu.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/edit/edlingu.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/edit/edlingu.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/edit/edlingu.cxx Fri Jan  3 14:44:44 2014
@@ -1878,6 +1878,7 @@ void    SwSpellIter::AddPortion(uno::Ref
                     switch (nWhich)
                     {
                         case RES_TXTATR_FIELD:
+                        case RES_TXTATR_ANNOTATION:
                         case RES_TXTATR_FTN:
                         case RES_TXTATR_FLYCNT:
                             bField = true;

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/fields/docufld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/fields/docufld.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/fields/docufld.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/fields/docufld.cxx Fri Jan  3 14:44:44 2014
@@ -1764,45 +1764,54 @@ const String& SwHiddenParaField::GetPar1
  --------------------------------------------------------------------*/
 
 SwPostItFieldType::SwPostItFieldType(SwDoc *pDoc)
-	: SwFieldType( RES_POSTITFLD ),mpDoc(pDoc)
+    : SwFieldType( RES_POSTITFLD )
+    , mpDoc(pDoc)
 {}
 /* ---------------------------------------------------------------------------
 
  ---------------------------------------------------------------------------*/
 SwFieldType* SwPostItFieldType::Copy() const
 {
-	return new SwPostItFieldType(mpDoc);
+    return new SwPostItFieldType(mpDoc);
 }
 
 
-/*--------------------------------------------------------------------
-	Beschreibung: SwPostItFieldType
- --------------------------------------------------------------------*/
 
-SwPostItField::SwPostItField( SwPostItFieldType* pT,
-		const String& rAuthor, const String& rTxt, const DateTime& rDateTime )
-	: SwField( pT ), sTxt( rTxt ), sAuthor( rAuthor ), aDateTime( rDateTime ), mpText(0), m_pTextObject(0)
+
+SwPostItField::SwPostItField(
+    SwPostItFieldType* pT,
+    const String& rCommentContent,
+    const String& rAuthor,
+    const String& rAuthorInitials,
+    const String& rName,
+    const DateTime& rDateTime )
+    : SwField( pT )
+    , msCommentContent( rCommentContent )
+    , msAuthor( rAuthor )
+    , msAuthorInitials( rAuthorInitials )
+    , msName( rName )
+    , maDateTime( rDateTime )
+    , mpText( NULL )
+    , m_pTextObject( NULL )
 {
 }
 
 
 SwPostItField::~SwPostItField()
 {
-	if ( m_pTextObject )
-	{
-		m_pTextObject->DisposeEditSource();
-		m_pTextObject->release();
-	}
+    if ( m_pTextObject != NULL )
+    {
+        m_pTextObject->DisposeEditSource();
+        m_pTextObject->release();
+    }
 
-	delete mpText;
+    delete mpText;
 }
 
-/* ---------------------------------------------------------------------------
 
- ---------------------------------------------------------------------------*/
 String SwPostItField::Expand() const
 {
-	return aEmptyStr;
+    return aEmptyStr;
 }
 
 
@@ -1811,169 +1820,200 @@ String SwPostItField::GetDescription() c
     return SW_RES(STR_NOTE);
 }
 
-/* ---------------------------------------------------------------------------
 
- ---------------------------------------------------------------------------*/
 SwField* SwPostItField::Copy() const
 {
-	SwPostItField* pRet = new SwPostItField( (SwPostItFieldType*)GetTyp(), sAuthor,
-								sTxt, aDateTime);
-	if (mpText)
-		pRet->SetTextObject( new OutlinerParaObject(*mpText) );
-	return pRet;
+    SwPostItField* pRet =
+        new SwPostItField(
+            (SwPostItFieldType*)GetTyp(),
+            msCommentContent,
+            msAuthor,
+            msAuthorInitials,
+            msName,
+            maDateTime);
+    if ( mpText != NULL )
+    {
+        pRet->SetTextObject( new OutlinerParaObject(*mpText) );
+    }
+
+    // Note: member <m_pTextObject> not copied.
+
+    return pRet;
 }
-/*--------------------------------------------------------------------
-	Beschreibung: Author setzen
- --------------------------------------------------------------------*/
+
 
 void SwPostItField::SetPar1(const String& rStr)
 {
-	sAuthor = rStr;
+    msAuthor = rStr;
 }
 
 const String& SwPostItField::GetPar1() const
 {
-	return sAuthor;
+    return msAuthor;
 }
 
-/*--------------------------------------------------------------------
-	Beschreibung: Text fuers PostIt setzen
- --------------------------------------------------------------------*/
 
 void SwPostItField::SetPar2(const String& rStr)
 {
-	sTxt = rStr;
+    msCommentContent = rStr;
 }
-/* ---------------------------------------------------------------------------
 
- ---------------------------------------------------------------------------*/
 String SwPostItField::GetPar2() const
 {
-		return sTxt;
+    return msCommentContent;
 }
 
+
+void SwPostItField::SetName(const String& rName)
+{
+    msName = rName;
+}
+
+const String& SwPostItField::GetName() const
+{
+    return msName;
+}
+
+
 const OutlinerParaObject* SwPostItField::GetTextObject() const
 {
-	return mpText;
+    return mpText;
 }
 
 void SwPostItField::SetTextObject( OutlinerParaObject* pText )
 {
-	delete mpText;
-	mpText = pText;
+    delete mpText;
+    mpText = pText;
 }
 
+
 sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
 {
     return (mpText) ? mpText->Count() : 1;
 }
 
+
 sal_Bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
 {
     switch( nWhichId )
-	{
-	case FIELD_PROP_PAR1:
-		rAny <<= OUString(sAuthor);
-		break;
-	case FIELD_PROP_PAR2:
-		{
-		rAny <<= OUString(sTxt);
-		break;
-		}
-	case FIELD_PROP_TEXT:
-		{
-			if ( !m_pTextObject )
-			{
-				SwPostItFieldType* pGetType = (SwPostItFieldType*)GetTyp();
-				SwDoc* pDoc = pGetType->GetDoc();
-				SwTextAPIEditSource* pObj = new SwTextAPIEditSource( pDoc );
-				const_cast <SwPostItField*> (this)->m_pTextObject = new SwTextAPIObject( pObj );
-				m_pTextObject->acquire();
-			}
+    {
+    case FIELD_PROP_PAR1:
+        rAny <<= OUString(msAuthor);
+        break;
+    case FIELD_PROP_PAR2:
+        {
+            rAny <<= OUString(msCommentContent);
+            break;
+        }
+    case FIELD_PROP_PAR3:
+        rAny <<= OUString(msAuthorInitials);
+        break;
+    case FIELD_PROP_PAR4:
+        rAny <<= OUString(msName);
+        break;
+    case FIELD_PROP_TEXT:
+        {
+            if ( !m_pTextObject )
+            {
+                SwPostItFieldType* pGetType = (SwPostItFieldType*)GetTyp();
+                SwDoc* pDoc = pGetType->GetDoc();
+                SwTextAPIEditSource* pObj = new SwTextAPIEditSource( pDoc );
+                const_cast <SwPostItField*> (this)->m_pTextObject = new SwTextAPIObject( pObj );
+                m_pTextObject->acquire();
+            }
 
-			if ( mpText )
-				m_pTextObject->SetText( *mpText );
-			else
-				m_pTextObject->SetString( sTxt );
-
-			uno::Reference < text::XText > xText( m_pTextObject );
-			rAny <<= xText;
-			break;
-		}
-	case FIELD_PROP_DATE:
-		{
-			util::Date aSetDate;
-			aSetDate.Day = aDateTime.GetDay();
-			aSetDate.Month = aDateTime.GetMonth();
-			aSetDate.Year = aDateTime.GetYear();
-			rAny.setValue(&aSetDate, ::getCppuType((util::Date*)0));
-		}
-		break;
-	case FIELD_PROP_DATE_TIME:
-		{
-				util::DateTime DateTimeValue;
-				DateTimeValue.HundredthSeconds = aDateTime.Get100Sec();
-				DateTimeValue.Seconds = aDateTime.GetSec();
-				DateTimeValue.Minutes = aDateTime.GetMin();
-				DateTimeValue.Hours = aDateTime.GetHour();
-				DateTimeValue.Day = aDateTime.GetDay();
-				DateTimeValue.Month = aDateTime.GetMonth();
-				DateTimeValue.Year = aDateTime.GetYear();
-				rAny <<= DateTimeValue;
-		}
-		break;
-	default:
-		DBG_ERROR("illegal property");
-	}
-	return sal_True;
+            if ( mpText )
+                m_pTextObject->SetText( *mpText );
+            else
+                m_pTextObject->SetString( msCommentContent );
+
+            uno::Reference < text::XText > xText( m_pTextObject );
+            rAny <<= xText;
+            break;
+        }
+    case FIELD_PROP_DATE:
+        {
+            util::Date aSetDate;
+            aSetDate.Day = maDateTime.GetDay();
+            aSetDate.Month = maDateTime.GetMonth();
+            aSetDate.Year = maDateTime.GetYear();
+            rAny.setValue(&aSetDate, ::getCppuType((util::Date*)0));
+        }
+        break;
+    case FIELD_PROP_DATE_TIME:
+        {
+            util::DateTime DateTimeValue;
+            DateTimeValue.HundredthSeconds = maDateTime.Get100Sec();
+            DateTimeValue.Seconds = maDateTime.GetSec();
+            DateTimeValue.Minutes = maDateTime.GetMin();
+            DateTimeValue.Hours = maDateTime.GetHour();
+            DateTimeValue.Day = maDateTime.GetDay();
+            DateTimeValue.Month = maDateTime.GetMonth();
+            DateTimeValue.Year = maDateTime.GetYear();
+            rAny <<= DateTimeValue;
+        }
+        break;
+    default:
+        DBG_ERROR("illegal property");
+    }
+    return sal_True;
 }
 
+
 sal_Bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
 {
     switch( nWhichId )
-	{
-	case FIELD_PROP_PAR1:
-		::GetString( rAny, sAuthor );
-		break;
-	case FIELD_PROP_PAR2:
-		::GetString( rAny, sTxt );
-		//#i100374# new string via api, delete complex text object so SwPostItNote picks up the new string
-		if (mpText)
-		{
-			delete mpText;
-			mpText = 0;
-		}
-		break;
-	case FIELD_PROP_TEXT:
-		DBG_ERROR("Not implemented!");
-		// ::GetString( rAny, sTxt );
-		break;
-	case FIELD_PROP_DATE:
-		if( rAny.getValueType() == ::getCppuType((util::Date*)0) )
-		{
-			util::Date aSetDate = *(util::Date*)rAny.getValue();
-			aDateTime = Date(aSetDate.Day, aSetDate.Month, aSetDate.Year);
-		}
-		break;
-	case FIELD_PROP_DATE_TIME:
-	{
-		util::DateTime aDateTimeValue;
-		if(!(rAny >>= aDateTimeValue))
-			return sal_False;
-		aDateTime.Set100Sec(aDateTimeValue.HundredthSeconds);
-		aDateTime.SetSec(aDateTimeValue.Seconds);
-		aDateTime.SetMin(aDateTimeValue.Minutes);
-		aDateTime.SetHour(aDateTimeValue.Hours);
-		aDateTime.SetDay(aDateTimeValue.Day);
-		aDateTime.SetMonth(aDateTimeValue.Month);
-		aDateTime.SetYear(aDateTimeValue.Year);
-	}
-	break;
-	default:
-		DBG_ERROR("illegal property");
-	}
-	return sal_True;
+    {
+    case FIELD_PROP_PAR1:
+        ::GetString( rAny, msAuthor );
+        break;
+    case FIELD_PROP_PAR2:
+        ::GetString( rAny, msCommentContent );
+        //#i100374# new string via api, delete complex text object so SwPostItNote picks up the new string
+        if (mpText)
+        {
+            delete mpText;
+            mpText = 0;
+        }
+        break;
+    case FIELD_PROP_PAR3:
+        ::GetString( rAny, msAuthorInitials );
+        break;
+    case FIELD_PROP_PAR4:
+        ::GetString( rAny, msName );
+        break;
+    case FIELD_PROP_TEXT:
+        DBG_ERROR("Not implemented!");
+        // ::GetString( rAny, msCommentContent );
+        break;
+    case FIELD_PROP_DATE:
+        if( rAny.getValueType() == ::getCppuType((util::Date*)0) )
+        {
+            util::Date aSetDate = *(util::Date*)rAny.getValue();
+            maDateTime = Date(aSetDate.Day, aSetDate.Month, aSetDate.Year);
+        }
+        break;
+    case FIELD_PROP_DATE_TIME:
+        {
+            util::DateTime aDateTimeValue;
+            if(!(rAny >>= aDateTimeValue))
+                return sal_False;
+            maDateTime.Set100Sec(aDateTimeValue.HundredthSeconds);
+            maDateTime.SetSec(aDateTimeValue.Seconds);
+            maDateTime.SetMin(aDateTimeValue.Minutes);
+            maDateTime.SetHour(aDateTimeValue.Hours);
+            maDateTime.SetDay(aDateTimeValue.Day);
+            maDateTime.SetMonth(aDateTimeValue.Month);
+            maDateTime.SetYear(aDateTimeValue.Year);
+        }
+        break;
+    default:
+        DBG_ERROR("illegal property");
+    }
+    return sal_True;
 }
+
+
 /*--------------------------------------------------------------------
 	Beschreibung: DokumentinfoFields
  --------------------------------------------------------------------*/

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/fields/postithelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/fields/postithelper.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/fields/postithelper.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/fields/postithelper.cxx Fri Jan  3 14:44:44 2014
@@ -82,62 +82,66 @@ struct LayoutInfoOrder
 
 } // eof anonymous namespace
 
-SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLayoutInfo >& rInfo, SwPosition& rPos )
+SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
+    SwLayoutInfo& o_rInfo,
+    const SwPosition& rAnchorPos,
+    const SwPosition* pAnnotationStartPos )
 {
     SwLayoutStatus aRet = INVISIBLE;
-	const SwTxtNode* pTxtNode = rPos.nNode.GetNode().GetTxtNode();
-    SwCntntNode* pNode = rPos.nNode.GetNode().GetCntntNode();	// getfirstcontentnode // getnext...
-    if( !pNode )
+    SwTxtNode* pTxtNode = rAnchorPos.nNode.GetNode().GetTxtNode();
+    if ( pTxtNode == NULL )
         return aRet;
-	SwIterator<SwTxtFrm,SwCntntNode> aIter( *pNode );
-    for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() )
+
+    SwIterator<SwTxtFrm,SwCntntNode> aIter( *pTxtNode );
+    for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm != NULL; pTxtFrm = aIter.Next() )
     {
         if( !pTxtFrm->IsFollow() )
         {
-            pTxtFrm = ((SwTxtFrm*)pTxtFrm)->GetFrmAtPos( rPos );
-	    SwPageFrm *pPage = pTxtFrm ? pTxtFrm->FindPageFrm() : 0;
-	    // #i103490#
-            if ( pPage && !pPage->IsInvalid() && !pPage->IsInvalidFly() )
+            pTxtFrm = pTxtFrm->GetFrmAtPos( rAnchorPos );
+            SwPageFrm *pPage = pTxtFrm ? pTxtFrm->FindPageFrm() : 0;
+            if ( pPage != NULL && !pPage->IsInvalid() && !pPage->IsInvalidFly() )
             {
-                SwLayoutInfo aInfo;
-                pTxtFrm->GetCharRect( aInfo.mPosition, rPos, 0 );
-                aInfo.mpAnchorFrm = pTxtFrm;
-                aInfo.mPageFrame = pPage->Frm();
-                aInfo.mPagePrtArea = pPage->Prt();
-                aInfo.mPagePrtArea.Pos() += aInfo.mPageFrame.Pos();
-                aInfo.mnPageNumber = pPage->GetPhyPageNum();
-                aInfo.meSidebarPosition = pPage->SidebarPosition();
-				aInfo.mRedlineAuthor = 0;
+                aRet = VISIBLE;
 
-                if( aRet == INVISIBLE )
+                o_rInfo.mpAnchorFrm = pTxtFrm;
+                pTxtFrm->GetCharRect( o_rInfo.mPosition, rAnchorPos, 0 );
+                if ( pAnnotationStartPos != NULL )
                 {
-                    aRet = VISIBLE;
-                    const IDocumentRedlineAccess* pIDRA = pNode->getIDocumentRedlineAccess();
-                    if( IDocumentRedlineAccess::IsShowChanges( pIDRA->GetRedlineMode() ) )
-                    {
-                        const SwRedline* pRedline = pIDRA->GetRedline( rPos, 0 );
-                        if( pRedline )
-                        {
-                            if( nsRedlineType_t::REDLINE_INSERT == pRedline->GetType() )
-                                aRet = INSERTED;
-                            else if( nsRedlineType_t::REDLINE_DELETE == pRedline->GetType() )
-                                aRet = DELETED;
-							aInfo.mRedlineAuthor = pRedline->GetAuthor();
-                        }
-                    }
+                    o_rInfo.mnStartNodeIdx = pAnnotationStartPos->nNode.GetIndex();
+                    o_rInfo.mnStartContent = pAnnotationStartPos->nContent.GetIndex();
                 }
-
+                else
                 {
-                    std::vector< SwLayoutInfo >::iterator aInsPosIter =
-                                std::lower_bound( rInfo.begin(), rInfo.end(),
-                                                  aInfo, LayoutInfoOrder() );
+                    o_rInfo.mnStartNodeIdx = 0;
+                    o_rInfo.mnStartContent = STRING_NOTFOUND;
+                }
+                o_rInfo.mPageFrame = pPage->Frm();
+                o_rInfo.mPagePrtArea = pPage->Prt();
+                o_rInfo.mPagePrtArea.Pos() += o_rInfo.mPageFrame.Pos();
+                o_rInfo.mnPageNumber = pPage->GetPhyPageNum();
+                o_rInfo.meSidebarPosition = pPage->SidebarPosition();
+                o_rInfo.mRedlineAuthor = 0;
 
-                    rInfo.insert( aInsPosIter, aInfo );
+                const IDocumentRedlineAccess* pIDRA = pTxtNode->getIDocumentRedlineAccess();
+                if( IDocumentRedlineAccess::IsShowChanges( pIDRA->GetRedlineMode() ) )
+                {
+                    const SwRedline* pRedline = pIDRA->GetRedline( rAnchorPos, 0 );
+                    if( pRedline )
+                    {
+                        if( nsRedlineType_t::REDLINE_INSERT == pRedline->GetType() )
+                            aRet = INSERTED;
+                        else if( nsRedlineType_t::REDLINE_DELETE == pRedline->GetType() )
+                            aRet = DELETED;
+                        o_rInfo.mRedlineAuthor = pRedline->GetAuthor();
+                    }
                 }
             }
         }
     }
-	return ((aRet==VISIBLE) && SwScriptInfo::IsInHiddenRange( *pTxtNode , rPos.nContent.GetIndex()) ) ? HIDDEN : aRet;
+
+    return ( (aRet==VISIBLE) && SwScriptInfo::IsInHiddenRange( *pTxtNode , rAnchorPos.nContent.GetIndex()) )
+             ? HIDDEN
+             : aRet;
 }
 
 long SwPostItHelper::getLayoutHeight( const SwRootFrm* pRoot )
@@ -170,22 +174,22 @@ unsigned long SwPostItHelper::getPageInf
 
 SwPosition SwAnnotationItem::GetAnchorPosition() const
 {
-	SwTxtFld* pFld = pFmtFld->GetTxtFld();
-	//if( pFld )
-	//{
-		SwTxtNode* pTNd = pFld->GetpTxtNode();
-	//	if( pTNd )
-	//	{
-			SwPosition aPos( *pTNd );
-			aPos.nContent.Assign( pTNd, *pFld->GetStart() );
-			return aPos;
-	//	}
-	//}
+    SwTxtFld* pTxtFld = mrFmtFld.GetTxtFld();
+    //if( pTxtFld )
+    //{
+        SwTxtNode* pTxtNode = pTxtFld->GetpTxtNode();
+        //if( pTxtNode )
+        //{
+            SwPosition aPos( *pTxtNode );
+            aPos.nContent.Assign( pTxtNode, *(pTxtFld->GetStart()) );
+            return aPos;
+        //}
+    //}
 }
 
 bool SwAnnotationItem::UseElement()
 {
-	return pFmtFld->IsFldInDoc();
+	return mrFmtFld.IsFldInDoc();
 }
 
 sw::sidebarwindows::SwSidebarWin* SwAnnotationItem::GetSidebarWindow(
@@ -197,7 +201,7 @@ sw::sidebarwindows::SwSidebarWin* SwAnno
     return new sw::annotation::SwAnnotationWin( rEditWin, nBits,
                                                 aMgr, aBits,
                                                 *this,
-                                                pFmtFld );
+                                                &mrFmtFld );
 }
 
 /*

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/fields/reffld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/fields/reffld.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/fields/reffld.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/fields/reffld.cxx Fri Jan  3 14:44:44 2014
@@ -310,16 +310,15 @@ void SwGetRefField::UpdateField( const S
 					nStt = 0;
 					break;
 
-				case REF_ONLYCAPTION:
-					{
+                case REF_ONLYCAPTION:
+                    {
                         const SwTxtAttr* const pTxtAttr = pTxtNd->GetTxtAttrForCharAt(nStt, RES_TXTATR_FIELD);
-						if( pTxtAttr )
-							nStt = SwGetExpField::GetReferenceTextPos(
-												pTxtAttr->GetFmtFld(), *pDoc );
-						else if( nStt + 1 < nEnd )
-							++nStt;
-					}
-					break;
+                        if( pTxtAttr != NULL )
+                            nStt = SwGetExpField::GetReferenceTextPos( pTxtAttr->GetFmtFld(), *pDoc );
+                        else if( nStt + 1 < nEnd )
+                            ++nStt;
+                    }
+                    break;
 
 				case REF_ONLYSEQNO:
 					if( nStt + 1 < nEnd )
@@ -832,7 +831,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor
     case REF_BOOKMARK:
         {
             IDocumentMarkAccess::const_iterator_t ppMark = pDoc->getIDocumentMarkAccess()->findMark(rRefMark);
-            if(ppMark != pDoc->getIDocumentMarkAccess()->getMarksEnd())
+            if(ppMark != pDoc->getIDocumentMarkAccess()->getAllMarksEnd())
             {
                 const ::sw::mark::IMark* pBkmk = ppMark->get();
                 const SwPosition* pPos = &pBkmk->GetMarkStart();

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/frmedt/fefly1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/frmedt/fefly1.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/frmedt/fefly1.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/frmedt/fefly1.cxx Fri Jan  3 14:44:44 2014
@@ -1483,9 +1483,8 @@ Size SwFEShell::RequestObjectResize( con
 			// search for a sequence field:
 			const SfxPoolItem* pItem;
 			for( sal_uInt16 n = 0, nEnd = pHts->Count(); n < nEnd; ++n )
-				if( RES_TXTATR_FIELD == ( pItem =
-							&(*pHts)[ n ]->GetAttr())->Which() &&
-					TYP_SEQFLD == ((SwFmtFld*)pItem)->GetField()->GetTypeId() )
+				if( RES_TXTATR_FIELD == ( pItem = &(*pHts)[ n ]->GetAttr())->Which()
+                    && TYP_SEQFLD == ((SwFmtFld*)pItem)->GetField()->GetTypeId() )
 				{
 					// sequence field found
 					SwFlyFrm* pChgFly = (SwFlyFrm*)pAnchor->GetUpper();

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/inc/MarkManager.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/inc/MarkManager.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/inc/MarkManager.hxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/inc/MarkManager.hxx Fri Jan  3 14:44:44 2014
@@ -50,6 +50,11 @@ namespace sw { namespace mark
 
             virtual ::sw::mark::IMark* getMarkForTxtNode(const SwTxtNode& rTxtNode, IDocumentMarkAccess::MarkType eMark);
 
+            virtual sw::mark::IMark* makeAnnotationMark(
+                const SwPaM& rPaM,
+                const ::rtl::OUString& rName );
+
+
             virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM);
             virtual bool renameMark(::sw::mark::IMark* io_pMark, const ::rtl::OUString& rNewName);
             virtual void correctMarksAbsolute(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const xub_StrLen nOffset);
@@ -63,9 +68,9 @@ namespace sw { namespace mark
             virtual void clearAllMarks();
 
             // marks 
-            virtual const_iterator_t getMarksBegin() const;
-            virtual const_iterator_t getMarksEnd() const;
-            virtual sal_Int32 getMarksCount() const;
+            virtual const_iterator_t getAllMarksBegin() const;
+            virtual const_iterator_t getAllMarksEnd() const;
+            virtual sal_Int32 getAllMarksCount() const;
             virtual const_iterator_t findMark(const ::rtl::OUString& rName) const;
 
             // bookmarks 
@@ -79,14 +84,36 @@ namespace sw { namespace mark
             virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& rPos) const;
             virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& rPos) const;
 
+            // Marks exclusive annotation marks
+            virtual const_iterator_t getCommonMarksBegin() const;
+            virtual const_iterator_t getCommonMarksEnd() const;
+            virtual sal_Int32 getCommonMarksCount() const;
+
+            // Annotation Marks
+            virtual const_iterator_t getAnnotationMarksBegin() const;
+            virtual const_iterator_t getAnnotationMarksEnd() const;
+            virtual sal_Int32 getAnnotationMarksCount() const;
+            virtual const_iterator_t findAnnotationMark( const ::rtl::OUString& rName ) const;
+
         private:
             // make names
             ::rtl::OUString getUniqueMarkName(const ::rtl::OUString& rName) const;
             void sortMarks();
 
-            container_t m_vMarks;
+            // container for all marks
+            container_t m_vAllMarks;
+
+            // additional container for bookmarks
             container_t m_vBookmarks;
+            // additional container for fieldmarks
             container_t m_vFieldmarks;
+
+            // container for annotation marks
+            container_t m_vAnnotationMarks;
+
+            // container for all marks except annotation marks
+            container_t m_vCommonMarks;
+
             SwDoc * const m_pDoc;
     };
 }}

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/inc/UndoDelete.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/inc/UndoDelete.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/inc/UndoDelete.hxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/inc/UndoDelete.hxx Fri Jan  3 14:44:44 2014
@@ -69,8 +69,10 @@ class SwUndoDelete
     sal_Bool SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd,
                     SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd );
 public:
-    SwUndoDelete( SwPaM&,
-            sal_Bool bFullPara = sal_False, sal_Bool bCalledByTblCpy = sal_False );
+    SwUndoDelete(
+        SwPaM&,
+        sal_Bool bFullPara = sal_False,
+        sal_Bool bCalledByTblCpy = sal_False );
     virtual ~SwUndoDelete();
 
     virtual void UndoImpl( ::sw::UndoRedoContext & );

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/inc/bookmrk.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/inc/bookmrk.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/inc/bookmrk.hxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/inc/bookmrk.hxx Fri Jan  3 14:44:44 2014
@@ -244,6 +244,7 @@ namespace sw { namespace mark
         public:
             TextFieldmark(const SwPaM& rPaM);
             virtual void InitDoc(SwDoc* const io_pDoc);
+            void ReleaseDoc(SwDoc* const pDoc);
     };
 
     class CheckboxFieldmark

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/inc/crossrefbookmark.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/inc/crossrefbookmark.hxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/inc/crossrefbookmark.hxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/inc/crossrefbookmark.hxx Fri Jan  3 14:44:44 2014
@@ -73,7 +73,6 @@ namespace sw { namespace mark
                 const KeyCode& rCode,
                 const ::rtl::OUString& rName,
                 const ::rtl::OUString& rShortName);
-            static ::rtl::OUString GenerateNewName();
             static bool IsLegalName(const ::rtl::OUString& rName);
     };
 
@@ -85,7 +84,6 @@ namespace sw { namespace mark
                 const KeyCode& rCode,
                 const ::rtl::OUString& rName,
                 const ::rtl::OUString& rShortName);
-            static ::rtl::OUString GenerateNewName();
             static bool IsLegalName(const ::rtl::OUString& rName);
             static const ::rtl::OUString our_sNamePrefix;
     };

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/table/swtable.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/table/swtable.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/table/swtable.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/table/swtable.cxx Fri Jan  3 14:44:44 2014
@@ -2586,8 +2586,8 @@ sal_uLong SwTableBox::IsValidNumTxtNd( s
                             *pAttr->GetStart() ||
                             *pAttr->GetAnyEnd() < rTxt.Len() )
                         {
-                            if ((*pAttr->GetStart() == nNextSetField) &&
-                                (pAttr->Which() == RES_TXTATR_FIELD))
+                            if ( (*pAttr->GetStart() == nNextSetField)
+                                 && (pAttr->Which() == RES_TXTATR_FIELD))
                             {
                                 // #i104949# hideous hack for report builder:
                                 // it inserts hidden variable-set fields at

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/EnhancedPDFExportHelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/EnhancedPDFExportHelper.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/EnhancedPDFExportHelper.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/EnhancedPDFExportHelper.cxx Fri Jan  3 14:44:44 2014
@@ -1628,7 +1628,7 @@ void SwEnhancedPDFExportHelper::Enhanced
                             sTitle += sDate;
                             aNote.Title = sTitle;
                             // Guess what the contents contains...
-                            aNote.Contents = pField->GetTxt();
+                            aNote.Contents = pField->GetContent();
 
                             // Link Export
                             pPDFExtOutDevData->CreateNote( rNoteRect.SVRect(), aNote, nNotePageNum );

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/inftxt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/inftxt.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/inftxt.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/inftxt.cxx Fri Jan  3 14:44:44 2014
@@ -37,11 +37,7 @@
 #include <editeng/brshitem.hxx>
 #include <editeng/splwrap.hxx>
 #include <editeng/pgrditem.hxx>
-// --> OD 2008-01-17 #newlistlevelattrs#
-#ifndef _SVX_TSTPITEM_HXX
 #include <editeng/tstpitem.hxx>
-#endif
-// <--
 
 #include <SwSmartTagMgr.hxx>
 #include <linguistic/lngprops.hxx>
@@ -57,9 +53,7 @@
 #include <viewopt.hxx>	// SwViewOptions
 #include <frmtool.hxx>	// DrawGraphic
 #include <IDocumentSettingAccess.hxx>
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
 #include <IDocumentDeviceAccess.hxx>
-#endif
 #include <paratr.hxx>	// SwFmtDrop
 #include <rootfrm.hxx>  // SwRootFrm
 #include <inftxt.hxx>	// SwTxtInfo
@@ -74,9 +68,7 @@
 #include <pam.hxx>
 #include <SwGrammarMarkUp.hxx>
 #include <cstdio>
-// --> FME 2004-06-08 #i12836# enhanced pdf export
 #include <EnhancedPDFExportHelper.hxx>
-// <--
 
 #include <unomid.h>
 

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/itratr.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/itratr.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/itratr.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/itratr.cxx Fri Jan  3 14:44:44 2014
@@ -770,17 +770,20 @@ void SwTxtNode::GetMinMaxSize( sal_uLong
 							nAdd = 20;
 						break;
 					}
-					case RES_TXTATR_FIELD :
-					{
-						SwField *pFld = (SwField*)pHint->GetFmtFld().GetField();
-                        const String aTxt = pFld->ExpandField(true);
-						if( lcl_MinMaxString( aArg, aIter.GetFnt(),	aTxt, 0,
-							aTxt.Len() ) )
-							nAdd = 20;
-						break;
-					}
-					default: aArg.nWordWidth = nOldWidth;
-							 aArg.nWordAdd = nOldAdd;
+
+                    case RES_TXTATR_FIELD :
+                    case RES_TXTATR_ANNOTATION :
+                        {
+                            SwField *pFld = (SwField*)pHint->GetFmtFld().GetField();
+                            const String aTxt = pFld->ExpandField(true);
+                            if( lcl_MinMaxString( aArg, aIter.GetFnt(),	aTxt, 0,
+                                aTxt.Len() ) )
+                                nAdd = 20;
+                            break;
+                        }
+
+                    default: aArg.nWordWidth = nOldWidth;
+                        aArg.nWordAdd = nOldAdd;
 
 				}
 				aIter.SeekAndChgAttrIter( ++nIdx, pOut );
@@ -959,37 +962,40 @@ sal_uInt16 SwTxtNode::GetScalingOfSelect
             XubString sTmp( cChar );
             SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 );
             nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
-			nIdx++;
+            nIdx++;
         }
-		else if ( pHint && ( cChar == CH_TXTATR_BREAKWORD || CH_TXTATR_INWORD ) )
-		{
-			switch( pHint->Which() )
-			{
-				case RES_TXTATR_FTN :
-				{
-					const XubString aTxt = pHint->GetFtn().GetNumStr();
+        else if ( pHint && ( cChar == CH_TXTATR_BREAKWORD || CH_TXTATR_INWORD ) )
+        {
+            switch( pHint->Which() )
+            {
+            case RES_TXTATR_FTN :
+                {
+                    const XubString aTxt = pHint->GetFtn().GetNumStr();
                     SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() );
 
                     nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
-					break;
-				}
-				case RES_TXTATR_FIELD :
-				{
-					SwField *pFld = (SwField*)pHint->GetFmtFld().GetField();
+                    break;
+                }
+
+            case RES_TXTATR_FIELD :
+            case RES_TXTATR_ANNOTATION :
+                {
+                    SwField *pFld = (SwField*)pHint->GetFmtFld().GetField();
                     String const aTxt = pFld->ExpandField(true);
                     SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() );
 
                     nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
-					break;
-				}
-				default:
-				{
-				// any suggestions for a default action?
-				}
-			} // end of switch
-			nIdx++;
-		} // end of while
-	}
+                    break;
+                }
+
+            default:
+                {
+                    // any suggestions for a default action?
+                }
+            } // end of switch
+            nIdx++;
+        } // end of while
+    }
 
 	nWidth = Max( nWidth, nProWidth );
 

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/pormulti.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/pormulti.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/pormulti.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/pormulti.cxx Fri Jan  3 14:44:44 2014
@@ -2261,24 +2261,26 @@ SwLinePortion* SwTxtFormatter::MakeRestP
 	if( pFld && !pFld->HasFollow() )
 		pFld = NULL;
 
-	SwLinePortion *pRest = NULL;
-	if( pFld )
-	{
+    SwLinePortion *pRest = NULL;
+    if( pFld )
+    {
         const SwTxtAttr *pHint = GetAttr( nPosition - 1 );
-		if( pHint && pHint->Which() == RES_TXTATR_FIELD )
-		{
-			pRest = NewFldPortion( GetInfo(), pHint );
-			if( pRest->InFldGrp() )
-				((SwFldPortion*)pRest)->TakeNextOffset( pFld );
-			else
-			{
-				delete pRest;
-				pRest = NULL;
-			}
-		}
-	}
+        if ( pHint
+             && ( pHint->Which() == RES_TXTATR_FIELD
+                  || pHint->Which() == RES_TXTATR_ANNOTATION ) )
+        {
+            pRest = NewFldPortion( GetInfo(), pHint );
+            if( pRest->InFldGrp() )
+                ((SwFldPortion*)pRest)->TakeNextOffset( pFld );
+            else
+            {
+                delete pRest;
+                pRest = NULL;
+            }
+        }
+    }
     if( !pHelpMulti )
-		return pRest;
+        return pRest;
 
     nPosition = nMultiPos + pHelpMulti->GetLen();
     SwMultiCreator* pCreate = GetInfo().GetMultiCreator( nMultiPos, 0 );

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/portxt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/portxt.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/portxt.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/portxt.cxx Fri Jan  3 14:44:44 2014
@@ -911,7 +911,7 @@ void SwHolePortion::HandlePortion( SwPor
 void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & /*rInf*/) const
 {
     // These shouldn't be painted!
-    // SwTxtPortion::Paint(rInf);
+    //SwTxtPortion::Paint(rInf);
 }
 
 sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & )

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfld.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfld.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfld.cxx Fri Jan  3 14:44:44 2014
@@ -429,6 +429,7 @@ SwLinePortion *SwTxtFormatter::NewExtraP
             break;
         }
     case RES_TXTATR_FIELD :
+    case RES_TXTATR_ANNOTATION :
         {
             pRet = NewFldPortion( rInf, pHint );
             break;

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfrm.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfrm.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfrm.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/text/txtfrm.cxx Fri Jan  3 14:44:44 2014
@@ -1097,27 +1097,30 @@ void SwTxtFrm::Modify( const SfxPoolItem
 				SetCompletePaint();
 			}
 			break;
-		case RES_TXTATR_FIELD:
-		{
-			nPos = *((SwFmtFld*)pNew)->GetTxtFld()->GetStart();
-			if( IsIdxInside( nPos, 1 ) )
-			{
-				if( pNew == pOld )
-				{
-					// Nur repainten
-					// opt: invalidate aufs Window ?
-					InvalidatePage();
-					SetCompletePaint();
-				}
-				else
-					_InvalidateRange( SwCharRange( nPos, 1 ) );
-			}
-			bSetFldsDirty = sal_True;
-            // ST2
-            if ( SwSmartTagMgr::Get().IsSmartTagsEnabled() )
-                SET_WRONG( nPos, nPos + 1, false )
-        }
-		break;
+
+        case RES_TXTATR_FIELD:
+        case RES_TXTATR_ANNOTATION:
+            {
+                nPos = *((SwFmtFld*)pNew)->GetTxtFld()->GetStart();
+                if( IsIdxInside( nPos, 1 ) )
+                {
+                    if( pNew == pOld )
+                    {
+                        // Nur repainten
+                        // opt: invalidate aufs Window ?
+                        InvalidatePage();
+                        SetCompletePaint();
+                    }
+                    else
+                        _InvalidateRange( SwCharRange( nPos, 1 ) );
+                }
+                bSetFldsDirty = sal_True;
+                // ST2
+                if ( SwSmartTagMgr::Get().IsSmartTagsEnabled() )
+                    SET_WRONG( nPos, nPos + 1, false )
+            }
+            break;
+
 		case RES_TXTATR_FTN :
 		{
 			nPos = *((SwFmtFtn*)pNew)->GetTxtFtn()->GetStart();
@@ -1131,12 +1134,11 @@ void SwTxtFrm::Modify( const SfxPoolItem
 			InvalidateLineNum();
 
 			SwAttrSet& rNewSet = *((SwAttrSetChg*)pNew)->GetChgSet();
-			const SfxPoolItem* pItem;
+			const SfxPoolItem* pItem = 0;
 			int nClear = 0;
 			MSHORT nCount = rNewSet.Count();
 
-			if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FTN,
-				sal_False, &pItem ))
+			if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FTN, sal_False, &pItem ))
 			{
 				nPos = *((SwFmtFtn*)pItem)->GetTxtFtn()->GetStart();
 				if( IsIdxInside( nPos, 1 ) )
@@ -1145,27 +1147,24 @@ void SwTxtFrm::Modify( const SfxPoolItem
 				--nCount;
 			}
 
-			if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FIELD,
-				sal_False, &pItem ))
-			{
-				nPos = *((SwFmtFld*)pItem)->GetTxtFld()->GetStart();
-				if( IsIdxInside( nPos, 1 ) )
-				{
-					const SfxPoolItem& rOldItem = ((SwAttrSetChg*)pOld)->
-										GetChgSet()->Get( RES_TXTATR_FIELD );
-					if( pItem == &rOldItem )
-					{
-						// Nur repainten
-						// opt: invalidate aufs Window ?
-						InvalidatePage();
-						SetCompletePaint();
-					}
-					else
-						_InvalidateRange( SwCharRange( nPos, 1 ) );
-				}
-				nClear |= 0x02;
-				--nCount;
-			}
+            if( SFX_ITEM_SET == rNewSet.GetItemState( RES_TXTATR_FIELD, sal_False, &pItem ))
+            {
+                nPos = *((SwFmtFld*)pItem)->GetTxtFld()->GetStart();
+                if( IsIdxInside( nPos, 1 ) )
+                {
+                    const SfxPoolItem& rOldItem =
+                        ((SwAttrSetChg*)pOld)->GetChgSet()->Get( RES_TXTATR_FIELD );
+                    if( pItem == &rOldItem )
+                    {
+                        InvalidatePage();
+                        SetCompletePaint();
+                    }
+                    else
+                        _InvalidateRange( SwCharRange( nPos, 1 ) );
+                }
+                nClear |= 0x02;
+                --nCount;
+            }
 			sal_Bool bLineSpace = SFX_ITEM_SET == rNewSet.GetItemState(
 											RES_PARATR_LINESPACING, sal_False ),
 					 bRegister	= SFX_ITEM_SET == rNewSet.GetItemState(

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrfld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrfld.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrfld.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrfld.cxx Fri Jan  3 14:44:44 2014
@@ -27,6 +27,7 @@
 #include "fldbas.hxx"          // fuer FieldType
 #include <fmtfld.hxx>
 #include <txtfld.hxx>
+#include <txtannotationfld.hxx>
 #include <docufld.hxx>
 #include <doc.hxx>
 
@@ -68,12 +69,17 @@ SwFmtFld::SwFmtFld( const SwField &rFld 
     , mpField( rFld.CopyField() )
     , mpTxtFld( NULL )
 {
-    // input field in-place editing
     if ( GetField()->GetTyp()->Which() == RES_INPUTFLD )
     {
+        // input field in-place editing
         SetWhich( RES_TXTATR_INPUTFIELD );
         dynamic_cast<SwInputField*>(GetField())->SetFmtFld( *this );
     }
+    else if ( GetField()->GetTyp()->Which() == RES_POSTITFLD )
+    {
+        // text annotation field
+        SetWhich( RES_TXTATR_ANNOTATION );
+    }
 }
 
 // #i24434#
@@ -91,12 +97,17 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAtt
     {
         rAttr.GetField()->GetTyp()->Add(this);
         mpField = rAttr.GetField()->CopyField();
-        // input field in-place editing
         if ( GetField()->GetTyp()->Which() == RES_INPUTFLD )
         {
+            // input field in-place editing
             SetWhich( RES_TXTATR_INPUTFIELD );
             dynamic_cast<SwInputField*>(GetField())->SetFmtFld( *this );
         }
+        else if ( GetField()->GetTyp()->Which() == RES_POSTITFLD )
+        {
+            // text annotation field
+            SetWhich( RES_TXTATR_ANNOTATION );
+        }
     }
 }
 
@@ -518,3 +529,47 @@ void SwTxtInputFld::UpdateTextNodeConten
     SwIndex aIdx( &GetTxtNode(), nIdx );
     GetTxtNode().ReplaceText( aIdx, nDelLen, rNewContent );
 }
+
+
+
+
+// text annotation field
+SwTxtAnnotationFld::SwTxtAnnotationFld(
+    SwFmtFld & rAttr,
+    xub_StrLen const nStart )
+    : SwTxtFld( rAttr, nStart )
+{
+}
+
+SwTxtAnnotationFld::~SwTxtAnnotationFld()
+{
+}
+
+
+::sw::mark::IMark* SwTxtAnnotationFld::GetAnnotationMark(
+    SwDoc* pDoc ) const
+{
+    const SwPostItField* pPostItField = dynamic_cast<const SwPostItField*>(GetFmtFld().GetField());
+    ASSERT( pPostItField != NULL, "<SwTxtAnnotationFld::GetAnnotationMark()> - field missing" );
+    if ( pPostItField == NULL )
+    {
+        return NULL;
+    }
+
+    if ( pDoc == NULL )
+    {
+        pDoc = static_cast<const SwPostItFieldType*>(pPostItField->GetTyp())->GetDoc();
+    }
+    ASSERT( pDoc != NULL, "<SwTxtAnnotationFld::GetAnnotationMark()> - missing document" );
+    if ( pDoc == NULL )
+    {
+        return NULL;
+    }
+
+    IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
+    IDocumentMarkAccess::const_iterator_t pMark = pMarksAccess->findAnnotationMark( pPostItField->GetName() );
+    return pMark != pMarksAccess->getAnnotationMarksEnd()
+           ? pMark->get()
+           : NULL;
+}
+

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrftn.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrftn.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrftn.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/atrftn.cxx Fri Jan  3 14:44:44 2014
@@ -282,7 +282,9 @@ void SwTxtFtn::SetNumber( const sal_uInt
 }
 
 // Die Fussnoten duplizieren
-void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
+void SwTxtFtn::CopyFtn(
+    SwTxtFtn & rDest,
+    SwTxtNode & rDestNode ) const
 {
     if (m_pStartNode && !rDest.GetStartNode())
     {
@@ -306,7 +308,7 @@ void SwTxtFtn::CopyFtn(SwTxtFtn & rDest,
 		SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
 		sal_uLong  nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
 
-        m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, sal_True );
+        m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, NULL, sal_True );
 
         // in case the destination section was not empty, delete the old nodes
         // before:   Src: SxxxE,  Dst: SnE

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/ndtxt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/ndtxt.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/ndtxt.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/ndtxt.cxx Fri Jan  3 14:44:44 2014
@@ -1071,22 +1071,22 @@ void SwTxtNode::Update(
             }
         }
 
-        const IDocumentMarkAccess* const pMarkAccess = getIDocumentMarkAccess();
-        for ( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
-              ppMark != pMarkAccess->getMarksEnd();
-              ppMark++ )
-        {
-            // Bookmarks must never grow to either side, when
-            // editing (directly) to the left or right (#i29942#)!
-            // And a bookmark with same start and end must remain
-            // to the left of the inserted text (used in XML import).
-            const ::sw::mark::IMark* const pMark = ppMark->get();
-            const SwPosition* pEnd = &pMark->GetMarkEnd();
-            SwIndex & rIdx = const_cast<SwIndex&>(pEnd->nContent);
-            if( this == &pEnd->nNode.GetNode() &&
-                rPos.GetIndex() == rIdx.GetIndex() )
-            {
-                rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() );
+        // Bookmarks must never grow to either side, when editing (directly) to the left or right (#i29942#)!
+        // And a bookmark with same start and end must remain to the left of the inserted text (used in XML import).
+        {
+            const IDocumentMarkAccess* const pMarkAccess = getIDocumentMarkAccess();
+            for ( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin();
+                ppMark != pMarkAccess->getAllMarksEnd();
+                ppMark++ )
+            {
+                const ::sw::mark::IMark* const pMark = ppMark->get();
+                const SwPosition* pEnd = &pMark->GetMarkEnd();
+                SwIndex & rIdx = const_cast<SwIndex&>(pEnd->nContent);
+                if( this == &pEnd->nNode.GetNode() &&
+                    rPos.GetIndex() == rIdx.GetIndex() )
+                {
+                    rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() );
+                }
             }
         }
     }
@@ -1320,6 +1320,10 @@ SwTxtFld* SwTxtNode::GetFldTxtAttrAt(
     pTxtFld = dynamic_cast<SwTxtFld*>(GetTxtAttrForCharAt( nIndex, RES_TXTATR_FIELD ));
     if ( pTxtFld == NULL )
     {
+        pTxtFld = dynamic_cast<SwTxtFld*>(GetTxtAttrForCharAt( nIndex, RES_TXTATR_ANNOTATION ));
+    }
+    if ( pTxtFld == NULL )
+    {
         pTxtFld =
             dynamic_cast<SwTxtFld*>( GetTxtAttrAt(
                 nIndex,
@@ -1372,9 +1376,8 @@ void lcl_CopyHint(
 
     // TabellenFormel muessen relativ kopiert werden.
     case RES_TXTATR_FIELD :
-    case RES_TXTATR_INPUTFIELD :
         {
-            if( pOtherDoc )
+            if( pOtherDoc != NULL )
             {
                 static_cast<const SwTxtFld*>(pHt)->CopyTxtFld( static_cast<SwTxtFld*>(pNewHt) );
             }
@@ -1389,14 +1392,23 @@ void lcl_CopyHint(
                     static_cast<const SwTxtFld*>(pHt)->GetTxtNode().FindTableNode();
                 if( pDstTblNd )
                 {
-                    SwTblField* const pTblFld = const_cast<SwTblField*>(
-                        static_cast<const SwTblField*>(pNewHt->GetFmtFld().GetField()));
+                    SwTblField* const pTblFld =
+                        const_cast<SwTblField*>(static_cast<const SwTblField*>(
+                            pNewHt->GetFmtFld().GetField()));
                     pTblFld->PtrToBoxNm( &pDstTblNd->GetTable() );
                 }
             }
         }
         break;
 
+    case RES_TXTATR_INPUTFIELD :
+    case RES_TXTATR_ANNOTATION :
+        if( pOtherDoc != NULL )
+        {
+            static_cast<const SwTxtFld*>(pHt)->CopyTxtFld( static_cast<SwTxtFld*>(pNewHt) );
+        }
+        break;
+
     case RES_TXTATR_TOXMARK :
         if( pOtherDoc && pDest && pDest->GetpSwpHints()
             && USHRT_MAX != pDest->GetpSwpHints()->GetPos( pNewHt ) )
@@ -1758,10 +1770,11 @@ void SwTxtNode::CopyText( SwTxtNode *con
         }
         else
         {
-            pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
+            pNewHt = pDest->InsertItem(
+                pHt->GetAttr(),
+                nAttrStt - nDeletedDummyChars,
                 nAttrEnd - nDeletedDummyChars,
-                      nsSetAttrMode::SETATTR_NOTXTATRCHR
-                    | nsSetAttrMode::SETATTR_IS_COPY);
+                nsSetAttrMode::SETATTR_NOTXTATRCHR | nsSetAttrMode::SETATTR_IS_COPY);
             if (pNewHt)
             {
                 lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
@@ -2996,69 +3009,74 @@ long SwTxtNode::GetLeftMarginForTabCalcu
 }
 // <--
 
-void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
-							xub_StrLen nEndPos, sal_Bool bExpandFlds ) const
+void SwTxtNode::Replace0xFF(
+    XubString& rTxt,
+    xub_StrLen& rTxtStt,
+    xub_StrLen nEndPos,
+    sal_Bool bExpandFlds ) const
 {
-	if( GetpSwpHints() )
-	{
-		sal_Unicode cSrchChr = CH_TXTATR_BREAKWORD;
-		for( int nSrchIter = 0; 2 > nSrchIter; ++nSrchIter,
-								cSrchChr = CH_TXTATR_INWORD )
-		{
-			xub_StrLen nPos = rTxt.Search( cSrchChr );
-			while( STRING_NOTFOUND != nPos && nPos < nEndPos )
+    if( GetpSwpHints() )
+    {
+        sal_Unicode cSrchChr = CH_TXTATR_BREAKWORD;
+        for( int nSrchIter = 0; 2 > nSrchIter; ++nSrchIter, cSrchChr = CH_TXTATR_INWORD )
+        {
+            xub_StrLen nPos = rTxt.Search( cSrchChr );
+            while( STRING_NOTFOUND != nPos && nPos < nEndPos )
             {
                 const SwTxtAttr* const pAttr =
                     GetTxtAttrForCharAt( rTxtStt + nPos );
-				if( pAttr )
-				{
-					switch( pAttr->Which() )
-					{
-					case RES_TXTATR_FIELD:
-						rTxt.Erase( nPos, 1 );
-						if( bExpandFlds )
-						{
+                if( pAttr )
+                {
+                    switch( pAttr->Which() )
+                    {
+                    case RES_TXTATR_FIELD:
+                    case RES_TXTATR_ANNOTATION:
+                        rTxt.Erase( nPos, 1 );
+                        if( bExpandFlds )
+                        {
                             const XubString aExpand(
                                 static_cast<SwTxtFld const*>(pAttr)->GetFmtFld().GetField()->ExpandField(true));
-							rTxt.Insert( aExpand, nPos );
-							nPos = nPos + aExpand.Len();
-							nEndPos = nEndPos + aExpand.Len();
-							rTxtStt = rTxtStt - aExpand.Len();
-						}
-						++rTxtStt;
-						break;
-					case RES_TXTATR_FTN:
-						rTxt.Erase( nPos, 1 );
-						if( bExpandFlds )
-						{
-							const SwFmtFtn& rFtn = pAttr->GetFtn();
-							XubString sExpand;
-							if( rFtn.GetNumStr().Len() )
-								sExpand = rFtn.GetNumStr();
-							else if( rFtn.IsEndNote() )
-								sExpand = GetDoc()->GetEndNoteInfo().aFmt.
-												GetNumStr( rFtn.GetNumber() );
-							else
-								sExpand = GetDoc()->GetFtnInfo().aFmt.
-												GetNumStr( rFtn.GetNumber() );
-							rTxt.Insert( sExpand, nPos );
-							nPos = nPos + sExpand.Len();
-							nEndPos = nEndPos + sExpand.Len();
-							rTxtStt = rTxtStt - sExpand.Len();
-						}
-						++rTxtStt;
-						break;
-					default:
-						rTxt.Erase( nPos, 1 );
-						++rTxtStt;
-					}
-				}
-				else
-					++nPos, ++nEndPos;
-				nPos = rTxt.Search( cSrchChr, nPos );
-			}
-		}
-	}
+                            rTxt.Insert( aExpand, nPos );
+                            nPos = nPos + aExpand.Len();
+                            nEndPos = nEndPos + aExpand.Len();
+                            rTxtStt = rTxtStt - aExpand.Len();
+                        }
+                        ++rTxtStt;
+                        break;
+
+                    case RES_TXTATR_FTN:
+                        rTxt.Erase( nPos, 1 );
+                        if( bExpandFlds )
+                        {
+                            const SwFmtFtn& rFtn = pAttr->GetFtn();
+                            XubString sExpand;
+                            if( rFtn.GetNumStr().Len() )
+                                sExpand = rFtn.GetNumStr();
+                            else if( rFtn.IsEndNote() )
+                                sExpand = GetDoc()->GetEndNoteInfo().aFmt.
+                                GetNumStr( rFtn.GetNumber() );
+                            else
+                                sExpand = GetDoc()->GetFtnInfo().aFmt.
+                                GetNumStr( rFtn.GetNumber() );
+                            rTxt.Insert( sExpand, nPos );
+                            nPos = nPos + sExpand.Len();
+                            nEndPos = nEndPos + sExpand.Len();
+                            rTxtStt = rTxtStt - sExpand.Len();
+                        }
+                        ++rTxtStt;
+                        break;
+
+                    default:
+                        rTxt.Erase( nPos, 1 );
+                        ++rTxtStt;
+                    }
+                }
+                else
+                    ++nPos, ++nEndPos;
+                nPos = rTxt.Search( cSrchChr, nPos );
+            }
+        }
+    }
 }
 
 /*************************************************************************
@@ -3170,28 +3188,29 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtN
                 }
             }
             else if ( pHt->HasDummyChar() && (nAttrStartIdx >= nIdx) )
-			{
-				aDestIdx = nInsPos + nAttrStartIdx;
-				switch( nWhich )
-				{
-				case RES_TXTATR_FIELD:
-					{
+            {
+                aDestIdx = nInsPos + nAttrStartIdx;
+                switch( nWhich )
+                {
+                case RES_TXTATR_FIELD:
+                case RES_TXTATR_ANNOTATION:
+                    {
                         XubString const aExpand(
                             static_cast<SwTxtFld const*>(pHt)->GetFmtFld().GetField()->ExpandField(true) );
-						if( aExpand.Len() )
-						{
-							aDestIdx++;		// dahinter einfuegen;
+                        if( aExpand.Len() )
+                        {
+                            aDestIdx++;		// dahinter einfuegen;
                             rDestNd.InsertText( aExpand, aDestIdx );
-							aDestIdx = nInsPos + nAttrStartIdx;
-							nInsPos = nInsPos + aExpand.Len();
+                            aDestIdx = nInsPos + nAttrStartIdx;
+                            nInsPos = nInsPos + aExpand.Len();
                         }
                         rDestNd.EraseText( aDestIdx, 1 );
-						--nInsPos;
-					}
-					break;
+                        --nInsPos;
+                    }
+                    break;
 
-				case RES_TXTATR_FTN:
-					{
+                case RES_TXTATR_FTN:
+                    {
                         if ( bWithFtn )
                         {
                             const SwFmtFtn& rFtn = pHt->GetFtn();
@@ -3200,42 +3219,42 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtN
                                 sExpand = rFtn.GetNumStr();
                             else if( rFtn.IsEndNote() )
                                 sExpand = GetDoc()->GetEndNoteInfo().aFmt.
-                                                GetNumStr( rFtn.GetNumber() );
+                                GetNumStr( rFtn.GetNumber() );
                             else
                                 sExpand = GetDoc()->GetFtnInfo().aFmt.
-                                                GetNumStr( rFtn.GetNumber() );
+                                GetNumStr( rFtn.GetNumber() );
                             if( sExpand.Len() )
                             {
                                 aDestIdx++;     // insert behind
                                 SvxEscapementItem aItem(
-                                        SVX_ESCAPEMENT_SUPERSCRIPT );
-                                rDestNd.InsertItem(aItem,
-                                        aDestIdx.GetIndex(),
-                                        aDestIdx.GetIndex() );
-                                rDestNd.InsertText( sExpand, aDestIdx,
-                                  IDocumentContentOperations::INS_EMPTYEXPAND);
+                                    SVX_ESCAPEMENT_SUPERSCRIPT );
+                                rDestNd.InsertItem(
+                                    aItem,
+                                    aDestIdx.GetIndex(),
+                                    aDestIdx.GetIndex() );
+                                rDestNd.InsertText( sExpand, aDestIdx, IDocumentContentOperations::INS_EMPTYEXPAND);
                                 aDestIdx = nInsPos + nAttrStartIdx;
                                 nInsPos = nInsPos + sExpand.Len();
                             }
                         }
                         rDestNd.EraseText( aDestIdx, 1 );
-						--nInsPos;
-					}
-					break;
+                        --nInsPos;
+                    }
+                    break;
 
-				default:
+                default:
                     rDestNd.EraseText( aDestIdx, 1 );
-					--nInsPos;
-				}
-			}
-		}
-	}
+                    --nInsPos;
+                }
+            }
+        }
+    }
 
-	if( bWithNum )
-	{
-		aDestIdx = nDestStt;
+    if( bWithNum )
+    {
+        aDestIdx = nDestStt;
         rDestNd.InsertText( GetNumString(), aDestIdx );
-	}
+    }
 
     if ( nHiddenChrs > 0 )
     {
@@ -3271,7 +3290,8 @@ const ModelToViewHelper::ConversionMap*
     for ( sal_uInt16 i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i )
     {
         const SwTxtAttr* pAttr = (*pSwpHints2)[i];
-        if ( RES_TXTATR_FIELD == pAttr->Which() )
+        if ( pAttr->Which() == RES_TXTATR_FIELD
+             || pAttr->Which() == RES_TXTATR_ANNOTATION )
         {
             const XubString aExpand(
                 static_cast<SwTxtFld const*>(pAttr)->GetFmtFld().GetField()->ExpandField(true));

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/thints.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/thints.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/thints.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/thints.cxx Fri Jan  3 14:44:44 2014
@@ -53,6 +53,7 @@
 #include <txtrfmrk.hxx>
 #include <txtftn.hxx>
 #include <txtfld.hxx>
+#include <txtannotationfld.hxx>
 #include <charatr.hxx>
 #include <charfmt.hxx>
 #include <frmfmt.hxx>
@@ -1046,12 +1047,29 @@ SwTxtAttr* MakeTxtAttr(
 	case RES_TXTATR_INETFMT:
 		pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd );
 		break;
+
     case RES_TXTATR_FIELD:
         pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt );
         break;
+
+    case RES_TXTATR_ANNOTATION:
+        {
+            pNew = new SwTxtAnnotationFld( static_cast<SwFmtFld &>(rNew), nStt );
+            if ( bIsCopy == COPY )
+            {
+                // On copy of the annotation field do not keep the annotated text range by removing
+                // the relation to its annotation mark (relation established via annotation field's name).
+                // If the annotation mark is also copied, the relation and thus the annotated text range will be reestablished,
+                // when the annotation mark is created and inserted into the document.
+                const_cast<SwPostItField*>(dynamic_cast< const SwPostItField* >(pNew->GetFmtFld().GetField()))->SetName( String() );
+            }
+        }
+        break;
+
     case RES_TXTATR_INPUTFIELD:
         pNew = new SwTxtInputFld( static_cast<SwFmtFld &>(rNew), nStt, nEnd );
         break;
+
 	case RES_TXTATR_FLYCNT:
 		{
 			// erst hier wird das Frame-Format kopiert (mit Inhalt) !!
@@ -1137,6 +1155,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* 
 			break;
 
 		case RES_TXTATR_FIELD:
+		case RES_TXTATR_ANNOTATION:
 		case RES_TXTATR_INPUTFIELD:
 			if( !pDoc->IsInDtor() )
 			{
@@ -1211,16 +1230,24 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* 
  *						SwTxtNode::Insert()
  *************************************************************************/
 
-SwTxtAttr*
-SwTxtNode::InsertItem( SfxPoolItem& rAttr,
-      const xub_StrLen nStart, const xub_StrLen nEnd, const SetAttrMode nMode )
+SwTxtAttr* SwTxtNode::InsertItem(
+    SfxPoolItem& rAttr,
+    const xub_StrLen nStart,
+    const xub_StrLen nEnd,
+    const SetAttrMode nMode )
 {
    // character attributes will be inserted as automatic styles:
     ASSERT( !isCHRATR(rAttr.Which()), "AUTOSTYLES - "
         "SwTxtNode::InsertItem should not be called with character attributes");
 
-    SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), rAttr, nStart, nEnd,
-            (nMode & nsSetAttrMode::SETATTR_IS_COPY) ? COPY : NEW, this );
+    SwTxtAttr *const pNew =
+        MakeTxtAttr(
+            *GetDoc(),
+            rAttr,
+            nStart,
+            nEnd,
+            (nMode & nsSetAttrMode::SETATTR_IS_COPY) ? COPY : NEW,
+            this );
 
     if ( pNew )
     {
@@ -2608,20 +2635,20 @@ bool SwpHints::CalcHiddenParaField()
     m_bCalcHiddenParaField = false;
     bool bOldHasHiddenParaField = m_bHasHiddenParaField;
     bool bNewHasHiddenParaField  = false;
-	const sal_uInt16	nSize = Count();
-	const SwTxtAttr *pTxtHt;
+    const sal_uInt16	nSize = Count();
+    const SwTxtAttr *pTxtHt;
 
-	for( sal_uInt16 nPos = 0; nPos < nSize; ++nPos )
-	{
-		pTxtHt = (*this)[ nPos ];
-		const sal_uInt16 nWhich = pTxtHt->Which();
+    for( sal_uInt16 nPos = 0; nPos < nSize; ++nPos )
+    {
+        pTxtHt = (*this)[ nPos ];
+        const sal_uInt16 nWhich = pTxtHt->Which();
 
-		if( RES_TXTATR_FIELD == nWhich )
-		{
-			const SwFmtFld& rFld = pTxtHt->GetFmtFld();
+        if( RES_TXTATR_FIELD == nWhich )
+        {
+            const SwFmtFld& rFld = pTxtHt->GetFmtFld();
             if( RES_HIDDENPARAFLD == rFld.GetField()->GetTyp()->Which() )
-			{
-				if( !((SwHiddenParaField*)rFld.GetField())->IsHidden() )
+            {
+                if( !((SwHiddenParaField*)rFld.GetField())->IsHidden() )
                 {
                     SetHiddenParaField(false);
                     return bOldHasHiddenParaField != bNewHasHiddenParaField;
@@ -2805,8 +2832,10 @@ void lcl_CheckSortNumber( const SwpHints
  * overwritten.
  * The return value indicates successful insertion.
  */
-bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
-        const SetAttrMode nMode )
+bool SwpHints::TryInsertHint(
+    SwTxtAttr* const pHint,
+    SwTxtNode &rNode,
+    const SetAttrMode nMode )
 {
     if ( USHRT_MAX == Count() ) // we're sorry, this flight is overbooked...
     {
@@ -2846,10 +2875,13 @@ bool SwpHints::TryInsertHint( SwTxtAttr*
         break;
     }
     // <--
+
     case RES_TXTATR_INETFMT:
         static_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode);
-		break;
+        break;
+
 	case RES_TXTATR_FIELD:
+	case RES_TXTATR_ANNOTATION:
 	case RES_TXTATR_INPUTFIELD:
 		{
 			sal_Bool bDelFirst = 0 != ((SwTxtFld*)pHint)->GetpTxtNode();
@@ -3118,7 +3150,7 @@ void SwpHints::DeleteAtPos( const sal_uI
     NoteInHistory( pHint );
     SwpHintsArray::DeleteAtPos( nPos );
 
-    if( RES_TXTATR_FIELD == pHint->Which() )
+    if( pHint->Which() == RES_TXTATR_FIELD )
     {
         const SwFieldType* pFldTyp = ((SwTxtFld*)pHint)->GetFmtFld().GetField()->GetTyp();
         if( RES_DDEFLD == pFldTyp->Which() )
@@ -3128,16 +3160,16 @@ void SwpHints::DeleteAtPos( const sal_uI
                 ((SwDDEFieldType*)pFldTyp)->DecRefCnt();
             ((SwTxtFld*)pHint)->ChgTxtNode( 0 );
         }
-        else if( RES_POSTITFLD == pFldTyp->Which() )
-        {
-            const_cast<SwFmtFld&>(((SwTxtFld*)pHint)->GetFmtFld()).Broadcast( SwFmtFldHint( &((SwTxtFld*)pHint)->GetFmtFld(), SWFMTFLD_REMOVED ) );
-        }
         else if ( m_bHasHiddenParaField &&
                  RES_HIDDENPARAFLD == pFldTyp->Which() )
         {
             m_bCalcHiddenParaField = true;
         }
     }
+    else if ( pHint->Which() == RES_TXTATR_ANNOTATION )
+    {
+        const_cast<SwFmtFld&>(((SwTxtFld*)pHint)->GetFmtFld()).Broadcast( SwFmtFldHint( &((SwTxtFld*)pHint)->GetFmtFld(), SWFMTFLD_REMOVED ) );
+    }
 
     CalcFlags();
     CHECK;
@@ -3172,6 +3204,7 @@ void SwTxtNode::ClearSwpHintsArr( bool b
                 break;
 
             case RES_TXTATR_FIELD:
+            case RES_TXTATR_ANNOTATION:
             case RES_TXTATR_INPUTFIELD:
                 if( bDelFields )
                     bDel = true;
@@ -3264,6 +3297,7 @@ sal_Unicode GetCharOfTxtAttr( const SwTx
         case RES_TXTATR_TOXMARK:
         case RES_TXTATR_META:
         case RES_TXTATR_METAFIELD:
+        case RES_TXTATR_ANNOTATION:
             cRet = CH_TXTATR_INWORD;
         break;
 
@@ -3271,11 +3305,6 @@ sal_Unicode GetCharOfTxtAttr( const SwTx
         case RES_TXTATR_FLYCNT:
         {
             cRet = CH_TXTATR_BREAKWORD;
-
-            // #i78149: PostIt fields should not break words for spell and grammar checking
-            if (rAttr.Which() == RES_TXTATR_FIELD && 
-                RES_POSTITFLD == rAttr.GetFmtFld().GetField()->GetTyp()->Which())
-                cRet = CH_TXTATR_INWORD;
         }
         break;
 

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/txtatr2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/txtatr2.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/txtatr2.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/txtnode/txtatr2.cxx Fri Jan  3 14:44:44 2014
@@ -308,7 +308,9 @@ SwTxtMeta::CreateTxtMeta(
     ::sw::MetaFieldManager & i_rTargetDocManager,
     SwTxtNode *const i_pTargetTxtNode,
     SwFmtMeta & i_rAttr,
-    xub_StrLen const i_nStart, xub_StrLen const i_nEnd, bool const i_bIsCopy)
+    xub_StrLen const i_nStart,
+    xub_StrLen const i_nEnd,
+    bool const i_bIsCopy)
 {
     if (COPY == i_bIsCopy)
     {   // i_rAttr is already cloned, now call DoCopy to copy the sw::Meta

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/undo/rolbck.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/undo/rolbck.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/undo/rolbck.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/undo/rolbck.cxx Fri Jan  3 14:44:44 2014
@@ -675,11 +675,13 @@ void SwHistoryBookmark::SetInDoc( SwDoc*
 
     if(pPam.get())
     {
-        if(pMark)
-            pMarkAccess->deleteMark(pMark);
-        ::sw::mark::IBookmark* const pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(
-            pMarkAccess->makeMark(*pPam, m_aName, m_eBkmkType));
-        if(pBookmark)
+        if ( pMark != NULL )
+        {
+            pMarkAccess->deleteMark( pMark );
+        }
+        ::sw::mark::IBookmark* const pBookmark =
+            dynamic_cast< ::sw::mark::IBookmark* >( pMarkAccess->makeMark(*pPam, m_aName, m_eBkmkType) );
+        if ( pBookmark != NULL )
         {
             pBookmark->SetKeyCode(m_aKeycode);
             pBookmark->SetShortName(m_aShortName);
@@ -835,6 +837,7 @@ SwHistoryResetAttrSet::SwHistoryResetAtt
             case RES_TXTATR_TOXMARK:
                 if (m_nStart != m_nEnd) break; // else: fall through!
             case RES_TXTATR_FIELD:
+            case RES_TXTATR_ANNOTATION:
             case RES_TXTATR_FLYCNT:
             case RES_TXTATR_FTN:
             case RES_TXTATR_META:
@@ -1042,7 +1045,9 @@ void SwHistory::Add( const SfxPoolItem* 
     ASSERT( !m_nEndDiff, "History was not deleted after REDO" );
 
     sal_uInt16 nWhich = pNewValue->Which();
-    if( (nWhich >= POOLATTR_END) || (nWhich == RES_TXTATR_FIELD) )
+    if( (nWhich >= POOLATTR_END)
+        || (nWhich == RES_TXTATR_FIELD)
+        || (nWhich == RES_TXTATR_ANNOTATION) )
         return;
 
     // no default Attribute?
@@ -1079,6 +1084,7 @@ void SwHistory::Add( SwTxtAttr* pHint, s
                             ->GetFlyCnt().GetFrmFmt() );
                 break;
             case RES_TXTATR_FIELD:
+            case RES_TXTATR_ANNOTATION:
                 pHt = new SwHistorySetTxtFld(
                             static_cast<SwTxtFld*>(pHint), nNodeIdx );
                 break;
@@ -1313,6 +1319,7 @@ void SwHistory::CopyAttr(
         switch( pHt->Which() )
         {
         case RES_TXTATR_FIELD:
+        case RES_TXTATR_ANNOTATION:
         case RES_TXTATR_INPUTFIELD:
             if( !bCopyFields )
                 bNextAttr = sal_True;

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/undo/unattr.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/undo/unattr.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/undo/unattr.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/undo/unattr.cxx Fri Jan  3 14:44:44 2014
@@ -881,7 +881,7 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedo
 
     const bool bToLast =  (1 == m_AttrSet.Count())
                        && (RES_TXTATR_FIELD <= *m_AttrSet.GetRanges())
-                       && (*m_AttrSet.GetRanges() <= RES_TXTATR_FTN);
+                       && (*m_AttrSet.GetRanges() <= RES_TXTATR_ANNOTATION);
 
     // restore old values
     m_pHistory->TmpRollback( pDoc, 0, !bToLast );

Modified: openoffice/branches/rejuvenate01/main/sw/source/core/undo/unbkmk.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/sw/source/core/undo/unbkmk.cxx?rev=1555112&r1=1555111&r2=1555112&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/sw/source/core/undo/unbkmk.cxx (original)
+++ openoffice/branches/rejuvenate01/main/sw/source/core/undo/unbkmk.cxx Fri Jan  3 14:44:44 2014
@@ -57,10 +57,9 @@ void SwUndoBookmark::SetInDoc( SwDoc* pD
 void SwUndoBookmark::ResetInDoc( SwDoc* pDoc )
 {
     IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
-    for (IDocumentMarkAccess::const_iterator_t ppBkmk =
-                pMarkAccess->getMarksBegin();
-            ppBkmk != pMarkAccess->getMarksEnd();
-            ++ppBkmk)
+    for ( IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->getAllMarksBegin();
+          ppBkmk != pMarkAccess->getAllMarksEnd();
+          ++ppBkmk )
     {
         if ( m_pHistoryBookmark->IsEqualBookmark( **ppBkmk ) )
         {



Mime
View raw message