You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/11/19 23:39:57 UTC

svn commit: r1543609 [24/32] - in /openoffice/branches/l10n40/main: ./ accessibility/inc/accessibility/extended/ accessibility/inc/accessibility/helper/ accessibility/inc/accessibility/standard/ accessibility/source/extended/ accessibility/source/helpe...

Modified: openoffice/branches/l10n40/main/sw/source/core/crsr/viscrs.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/crsr/viscrs.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/crsr/viscrs.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/crsr/viscrs.cxx Tue Nov 19 22:39:40 2013
@@ -42,12 +42,13 @@
 #include <viewimp.hxx>
 #include <dview.hxx>
 #include <rootfrm.hxx>
-#include <txtfrm.hxx>   // SwTxtFrm
+#include <txtfrm.hxx>
 #include <docary.hxx>
 #include <extinput.hxx>
 #include <ndtxt.hxx>
+#include <txtfld.hxx>
 #include <scriptinfo.hxx>
-#include <mdiexp.hxx>			// GetSearchDialog
+#include <mdiexp.hxx>
 #ifndef _COMCORE_HRC
 #include <comcore.hrc>			// ResId fuer Abfrage wenn zu Search & Replaces
 #endif
@@ -56,6 +57,9 @@
 #include <svx/sdrpaintwindow.hxx>
 #include <vcl/svapp.hxx>
 #include <svx/sdr/overlay/overlayselection.hxx>
+#include <overlayrangesoutline.hxx>
+
+#include <boost/scoped_ptr.hpp>
 
 extern void SwCalcPixStatics( OutputDevice *pOut );
 
@@ -510,9 +514,11 @@ void SwVisCrsr::_SetPosAndShow()
 //////////////////////////////////////////////////////////////////////////////
 
 SwSelPaintRects::SwSelPaintRects( const SwCrsrShell& rCSh )
-:	SwRects( 0 ),
-	pCShell( &rCSh ),
-	mpCursorOverlay(0)
+    : SwRects( 0 )
+    , pCShell( &rCSh )
+    , mpCursorOverlay( 0 )
+    , mbShowTxtInputFldOverlay( true )
+    , mpTxtInputFldOverlay( NULL )
 {
 }
 
@@ -523,91 +529,174 @@ SwSelPaintRects::~SwSelPaintRects()
 
 void SwSelPaintRects::swapContent(SwSelPaintRects& rSwap)
 {
-	SwRects aTempRects;
-	aTempRects.Insert(this, 0);
+    SwRects aTempRects;
+    aTempRects.Insert(this, 0);
 
-	Remove(0, Count());
-	Insert(&rSwap, 0);
+    Remove(0, Count());
+    Insert(&rSwap, 0);
 
-	rSwap.Remove(0, rSwap.Count());
-	rSwap.Insert(&aTempRects, 0);
+    rSwap.Remove(0, rSwap.Count());
+    rSwap.Insert(&aTempRects, 0);
 
-	// #i75172# also swap mpCursorOverlay
-	sdr::overlay::OverlayObject* pTempOverlay = getCursorOverlay();
-	setCursorOverlay(rSwap.getCursorOverlay());
-	rSwap.setCursorOverlay(pTempOverlay);
+    // #i75172# also swap mpCursorOverlay
+    sdr::overlay::OverlayObject* pTempOverlay = getCursorOverlay();
+    setCursorOverlay(rSwap.getCursorOverlay());
+    rSwap.setCursorOverlay(pTempOverlay);
+
+    const bool bTempShowTxtInputFldOverlay = mbShowTxtInputFldOverlay;
+    mbShowTxtInputFldOverlay = rSwap.mbShowTxtInputFldOverlay;
+    rSwap.mbShowTxtInputFldOverlay = bTempShowTxtInputFldOverlay;
+
+    sw::overlay::OverlayRangesOutline* pTempTxtInputFldOverlay = mpTxtInputFldOverlay;
+    mpTxtInputFldOverlay = rSwap.mpTxtInputFldOverlay;
+    rSwap.mpTxtInputFldOverlay = pTempTxtInputFldOverlay;
 }
 
 void SwSelPaintRects::Hide()
 {
-	if(mpCursorOverlay)
-	{
-		delete mpCursorOverlay;
-		mpCursorOverlay = 0;
-	}
+    if(mpCursorOverlay)
+    {
+        delete mpCursorOverlay;
+        mpCursorOverlay = 0;
+    }
 
-	SwRects::Remove( 0, Count() );
+    if ( mpTxtInputFldOverlay != NULL )
+    {
+        delete mpTxtInputFldOverlay;
+        mpTxtInputFldOverlay = NULL;
+    }
+
+    SwRects::Remove( 0, Count() );
 }
 
 void SwSelPaintRects::Show()
 {
-	SdrView* pView = (SdrView*)pCShell->GetDrawView();
+    SdrView* pView = (SdrView*)pCShell->GetDrawView();
 
-	if(pView && pView->PaintWindowCount())
-	{
-		// reset rects
-		SwRects::Remove( 0, SwRects::Count() );
-		FillRects();
+    if(pView && pView->PaintWindowCount())
+    {
+        // reset rects
+        SwRects::Remove( 0, SwRects::Count() );
+        FillRects();
 
-		// get new rects
-		std::vector< basegfx::B2DRange > aNewRanges;
+        // get new rects
+        std::vector< basegfx::B2DRange > aNewRanges;
 
-		for(sal_uInt16 a(0); a < Count(); a++)
-		{
-			const SwRect aNextRect((*this)[a]);
-			const Rectangle aPntRect(aNextRect.SVRect());
+        for(sal_uInt16 a(0); a < Count(); a++)
+        {
+            const SwRect aNextRect((*this)[a]);
+            const Rectangle aPntRect(aNextRect.SVRect());
 
             aNewRanges.push_back(basegfx::B2DRange(
                 aPntRect.Left(), aPntRect.Top(),
                 aPntRect.Right() + 1, aPntRect.Bottom() + 1));
-		}
+        }
 
-		if(mpCursorOverlay)
-		{
-			if(aNewRanges.size())
-			{
-				static_cast< sdr::overlay::OverlaySelection* >(mpCursorOverlay)->setRanges(aNewRanges);
-			}
-			else
-			{
-				delete mpCursorOverlay;
-				mpCursorOverlay = 0;
-			}
-		}
-		else if(Count())
-		{
-			SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
-			sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+        if(mpCursorOverlay)
+        {
+            if(aNewRanges.size())
+            {
+                static_cast< sdr::overlay::OverlaySelection* >(mpCursorOverlay)->setRanges(aNewRanges);
+            }
+            else
+            {
+                delete mpCursorOverlay;
+                mpCursorOverlay = 0;
+            }
+        }
+        else if(Count())
+        {
+            SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
+            sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
 
-			if(pTargetOverlay)
-			{
+            if(pTargetOverlay)
+            {
                 // get the system's hilight color
                 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
                 const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
 
-				// create correct selection
-				mpCursorOverlay = new sdr::overlay::OverlaySelection(
-					sdr::overlay::OVERLAY_TRANSPARENT,
-					aHighlight, 
-					aNewRanges,
+                // create correct selection
+                mpCursorOverlay = new sdr::overlay::OverlaySelection(
+                    sdr::overlay::OVERLAY_TRANSPARENT,
+                    aHighlight, 
+                    aNewRanges,
                     true);
 
-				pTargetOverlay->add(*mpCursorOverlay);
-			}
-		}
-	}
+                pTargetOverlay->add(*mpCursorOverlay);
+            }
+        }
+
+        HighlightInputFld();
+    }
 }
 
+
+void SwSelPaintRects::HighlightInputFld()
+{
+    std::vector< basegfx::B2DRange > aInputFldRanges;
+
+    if ( mbShowTxtInputFldOverlay )
+    {
+        SwTxtInputFld* pCurTxtInputFldAtCrsr =
+            dynamic_cast<SwTxtInputFld*>(GetShell()->GetTxtFldAtPos( GetShell()->GetCrsr()->Start(), false ));
+        if ( pCurTxtInputFldAtCrsr != NULL )
+        {
+            SwTxtNode* pTxtNode = pCurTxtInputFldAtCrsr->GetpTxtNode();
+            ::boost::scoped_ptr<SwShellCrsr> pCrsrForInputTxtFld(
+                new SwShellCrsr( *GetShell(), SwPosition( *pTxtNode, *(pCurTxtInputFldAtCrsr->GetStart()) ) ) );
+            pCrsrForInputTxtFld->SetMark();
+            pCrsrForInputTxtFld->GetMark()->nNode = *pTxtNode;
+            pCrsrForInputTxtFld->GetMark()->nContent.Assign( pTxtNode, *(pCurTxtInputFldAtCrsr->End()) );
+
+            pCrsrForInputTxtFld->FillRects();
+
+            for( sal_uInt16 a(0); a < pCrsrForInputTxtFld->Count(); ++a )
+            {
+                const SwRect aNextRect((*pCrsrForInputTxtFld)[a]);
+                const Rectangle aPntRect(aNextRect.SVRect());
+
+                aInputFldRanges.push_back(basegfx::B2DRange(
+                    aPntRect.Left(), aPntRect.Top(),
+                    aPntRect.Right() + 1, aPntRect.Bottom() + 1));
+            }
+        }
+    }
+
+    if ( aInputFldRanges.size() > 0 )
+    {
+        if ( mpTxtInputFldOverlay != NULL )
+        {
+            mpTxtInputFldOverlay->setRanges( aInputFldRanges );
+        }
+        else
+        {
+            SdrView* pView = (SdrView*)GetShell()->GetDrawView();
+            SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
+            sdr::overlay::OverlayManager* pTargetOverlay = pCandidate->GetOverlayManager();
+
+            if(pTargetOverlay)
+            {
+                // use system's hilight color with decreased luminance as highlight color
+                const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+                Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+                aHighlight.DecreaseLuminance( 128 );
+
+                mpTxtInputFldOverlay = new sw::overlay::OverlayRangesOutline( aHighlight, aInputFldRanges );
+                pTargetOverlay->add( *mpTxtInputFldOverlay );
+            }
+        }
+    }
+    else
+    {
+        if ( mpTxtInputFldOverlay != NULL )
+        {
+            delete mpTxtInputFldOverlay;
+            mpTxtInputFldOverlay = NULL;
+        }
+    }
+}
+
+
 void SwSelPaintRects::Invalidate( const SwRect& rRect )
 {
 	sal_uInt16 nSz = Count();
@@ -675,24 +764,38 @@ void SwSelPaintRects::Get1PixelInLogic( 
 
 /*  */
 
-SwShellCrsr::SwShellCrsr( const SwCrsrShell& rCShell, const SwPosition &rPos )
-	: SwCursor(rPos,0,false), SwSelPaintRects(rCShell), pPt(SwPaM::GetPoint())
+SwShellCrsr::SwShellCrsr(
+    const SwCrsrShell& rCShell,
+    const SwPosition &rPos )
+    : SwCursor(rPos,0,false)
+    , SwSelPaintRects(rCShell)
+    , pPt(SwPaM::GetPoint())
 {}
 
 
-SwShellCrsr::SwShellCrsr( const SwCrsrShell& rCShell, const SwPosition &rPos,
-							const Point& rPtPos, SwPaM* pRing )
-	: SwCursor(rPos, pRing, false), SwSelPaintRects(rCShell), aMkPt(rPtPos),
-	aPtPt(rPtPos), pPt(SwPaM::GetPoint())
+SwShellCrsr::SwShellCrsr(
+    const SwCrsrShell& rCShell,
+    const SwPosition &rPos,
+    const Point& rPtPos,
+    SwPaM* pRing )
+    : SwCursor(rPos, pRing, false)
+    , SwSelPaintRects(rCShell)
+    , aMkPt(rPtPos)
+    , aPtPt(rPtPos)
+    , pPt(SwPaM::GetPoint())
 {}
 
 
 SwShellCrsr::SwShellCrsr( SwShellCrsr& rICrsr )
-	: SwCursor(rICrsr), SwSelPaintRects(*rICrsr.GetShell()),
-	aMkPt(rICrsr.GetMkPos()), aPtPt(rICrsr.GetPtPos()), pPt(SwPaM::GetPoint())
+    : SwCursor(rICrsr)
+    , SwSelPaintRects(*rICrsr.GetShell())
+    , aMkPt(rICrsr.GetMkPos())
+    , aPtPt(rICrsr.GetPtPos())
+    , pPt(SwPaM::GetPoint())
 {}
 
-SwShellCrsr::~SwShellCrsr() {}
+SwShellCrsr::~SwShellCrsr()
+{}
 
 
 bool SwShellCrsr::IsReadOnlyAvailable() const
@@ -711,14 +814,14 @@ void SwShellCrsr::SetMark()
 
 void SwShellCrsr::FillRects()
 {
-	// die neuen Rechtecke berechnen
-	if( HasMark() &&
-		GetPoint()->nNode.GetNode().IsCntntNode() &&
-		GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
-		(GetMark()->nNode == GetPoint()->nNode ||
-		(GetMark()->nNode.GetNode().IsCntntNode() &&
-		 GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) )	))
-		GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() );	//swmod 071107//swmod 071225
+    // die neuen Rechtecke berechnen
+    if( HasMark() &&
+        GetPoint()->nNode.GetNode().IsCntntNode() &&
+        GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
+        (GetMark()->nNode == GetPoint()->nNode ||
+        (GetMark()->nNode.GetNode().IsCntntNode() &&
+        GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) )	))
+        GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() );	//swmod 071107//swmod 071225
 }
 
 

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/dbgoutsw.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/dbgoutsw.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/dbgoutsw.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/dbgoutsw.cxx Tue Nov 19 22:39:40 2013
@@ -170,7 +170,7 @@ map<sal_uInt16,String,CompareUShort> & G
         aItemWhichMap[RES_TXTATR_REFMARK] = String("TXTATR_REFMARK", RTL_TEXTENCODING_ASCII_US);
         aItemWhichMap[RES_TXTATR_TOXMARK] = String("TXTATR_TOXMARK", RTL_TEXTENCODING_ASCII_US);
         aItemWhichMap[RES_TXTATR_CHARFMT] = String("TXTATR_CHARFMT", RTL_TEXTENCODING_ASCII_US);
-        aItemWhichMap[RES_TXTATR_DUMMY5] = String("TXTATR_DUMMY5", RTL_TEXTENCODING_ASCII_US);
+        aItemWhichMap[RES_TXTATR_INPUTFIELD] = String("TXTATR_INPUTFIELD", RTL_TEXTENCODING_ASCII_US);
         aItemWhichMap[RES_TXTATR_CJK_RUBY] = String("TXTATR_CJK_RUBY", RTL_TEXTENCODING_ASCII_US);
         aItemWhichMap[RES_TXTATR_UNKNOWN_CONTAINER] = String("TXTATR_UNKNOWN_CONTAINER", RTL_TEXTENCODING_ASCII_US);
         aItemWhichMap[RES_TXTATR_META] = String("TXTATR_META", RTL_TEXTENCODING_ASCII_US);
@@ -320,7 +320,7 @@ const String lcl_dbg_out(const SwTxtAttr
 
     aStr += String::CreateFromInt32(*rAttr.GetStart());
     aStr += String("->", RTL_TEXTENCODING_ASCII_US);
-    aStr += String::CreateFromInt32(*rAttr.GetEnd());
+    aStr += String::CreateFromInt32(*rAttr.End());
     aStr += String(" ", RTL_TEXTENCODING_ASCII_US);
     aStr += lcl_dbg_out(rAttr.GetAttr());
 

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/doc.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/doc.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/doc.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/doc.cxx Tue Nov 19 22:39:40 2013
@@ -259,9 +259,8 @@ void SwDoc::set(/*[in]*/ DocumentSetting
                 if (pOutlineRule)
                 {
                     pOutlineRule->Validate();
-                    // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+                    // counting of phantoms depends on <IsOldNumbering()>
                     pOutlineRule->SetCountPhantoms( !mbOldNumbering );
-                    // <--
                 }
             }
             break;
@@ -291,42 +290,43 @@ void SwDoc::set(/*[in]*/ DocumentSetting
             mbOutlineLevelYieldsOutlineRule = value;
             break;
 
-	    case TABLE_ROW_KEEP:
-	        mbTableRowKeep = value;
-	        break;
-
-	    case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
-		    mbIgnoreTabsAndBlanksForLineCalculation = value;
-			break;
-
-	    case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
-		    mbDoNotCaptureDrawObjsOnPage = value;
-			break;
+        case TABLE_ROW_KEEP:
+            mbTableRowKeep = value;
+            break;
+
+        case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
+            mbIgnoreTabsAndBlanksForLineCalculation = value;
+            break;
+
+        case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
+            mbDoNotCaptureDrawObjsOnPage = value;
+            break;
 
-        // --> OD 2006-08-25 #i68949#
         case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
             mbClipAsCharacterAnchoredWriterFlyFrames = value;
             break;
-        // <--
+
         case UNIX_FORCE_ZERO_EXT_LEADING:
             mbUnixForceZeroExtLeading = value;
             break;
+
         case PROTECT_FORM:
-	    mbProtectForm = value;
-	    break;
+            mbProtectForm = value;
+            break;
 
         case USE_OLD_PRINTER_METRICS:
             mbOldPrinterMetrics = value;
             break;
+
         case TABS_RELATIVE_TO_INDENT:
             mbTabRelativeToIndent = value;
         break;
-        // --> OD 2008-06-05 #i89181#
+
         case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
             mbTabAtLeftIndentForParagraphsInList = value;
         break;
-        // <--
-         // COMPATIBILITY FLAGS END
+
+        // COMPATIBILITY FLAGS END
 
         case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
             mbLastBrowseMode = value;
@@ -2693,24 +2693,21 @@ String SwDoc::GetPaMDescr(const SwPaM & 
     return aResult;
 }
 
-// -> #111840#
-SwField * SwDoc::GetField(const SwPosition & rPos)
+SwField * SwDoc::GetFieldAtPos(const SwPosition & rPos)
 {
-    SwTxtFld * const pAttr = GetTxtFld(rPos);
+    SwTxtFld * const pAttr = GetTxtFldAtPos(rPos);
 
     return (pAttr) ? const_cast<SwField *>( pAttr->GetFmtFld().GetField() ) : 0;
 }
 
-SwTxtFld * SwDoc::GetTxtFld(const SwPosition & rPos)
+SwTxtFld * SwDoc::GetTxtFldAtPos(const SwPosition & rPos)
 {
     SwTxtNode * const pNode = rPos.nNode.GetNode().GetTxtNode();
 
-    return (pNode)
-        ? static_cast<SwTxtFld*>( pNode->GetTxtAttrForCharAt(
-                    rPos.nContent.GetIndex(), RES_TXTATR_FIELD) )
+    return (pNode != NULL)
+        ? pNode->GetFldTxtAttrAt( rPos.nContent.GetIndex(), true )
         : 0;
 }
-// <- #111840#
 
 bool SwDoc::ContainsHiddenChars() const
 {

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docedt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docedt.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docedt.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docedt.cxx Tue Nov 19 22:39:40 2013
@@ -1495,7 +1495,7 @@ lcl_CalcBreaks( ::std::vector<xub_StrLen
         if ((CH_TXTATR_INWORD == c) || (CH_TXTATR_BREAKWORD == c))
         {
             SwTxtAttr const * const pAttr( pTxtNode->GetTxtAttrForCharAt(i) );
-            if (pAttr && pAttr->GetEnd() && (*pAttr->GetEnd() > nEnd))
+            if (pAttr && pAttr->End() && (*pAttr->End() > nEnd))
             {
                 ASSERT(pAttr->HasDummyChar(), "GetTxtAttrForCharAt broken?");
                 rBreaks.push_back(i);
@@ -1680,7 +1680,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & 
 					break;
 
 				if( nMkCntPos == *pAttr->GetStart() &&
-					0 != (pEndIdx = pAttr->GetEnd()) &&
+					0 != (pEndIdx = pAttr->End()) &&
 					*pEndIdx == *pAttr->GetStart() )
 					pTxtNd->DestroyAttr( pHts->Cut( n ) );
 			}

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docfld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docfld.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docfld.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docfld.cxx Tue Nov 19 22:39:40 2013
@@ -755,18 +755,20 @@ void SwDoc::SetNewFldLst(bool bFlag)
 // der StartIndex kann optional mit angegeben werden (z.B. wenn dieser
 // zuvor schon mal erfragt wurde - ist sonst eine virtuelle Methode !!)
 
-_SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld,
-							const SwIndex* pIdx )
-{
-	eSetGetExpFldType = TEXTFIELD;
-	CNTNT.pTxtFld = pFld;
-	nNode = rNdIdx.GetIndex();
-	if( pIdx )
-		nCntnt = pIdx->GetIndex();
-	else if( pFld )
-		nCntnt = *pFld->GetStart();
-	else
-		nCntnt = 0;
+_SetGetExpFld::_SetGetExpFld(
+    const SwNodeIndex& rNdIdx,
+    const SwTxtFld* pFld,
+    const SwIndex* pIdx )
+{
+    eSetGetExpFldType = TEXTFIELD;
+    CNTNT.pTxtFld = pFld;
+    nNode = rNdIdx.GetIndex();
+    if( pIdx )
+        nCntnt = pIdx->GetIndex();
+    else if( pFld )
+        nCntnt = *pFld->GetStart();
+    else
+        nCntnt = 0;
 }
 
 _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx,
@@ -906,6 +908,15 @@ void _SetGetExpFld::SetBodyPos( const Sw
 	}
 }
 
+sal_Bool _SetGetExpFld::operator==( const _SetGetExpFld& rFld ) const
+{
+    return nNode == rFld.nNode
+           && nCntnt == rFld.nCntnt
+           && ( !CNTNT.pTxtFld
+                || !rFld.CNTNT.pTxtFld
+                || CNTNT.pTxtFld == rFld.CNTNT.pTxtFld );
+}
+
 sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
 {
 	if( nNode < rFld.nNode || ( nNode == rFld.nNode && nCntnt < rFld.nCntnt ))
@@ -2716,17 +2727,12 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxt
             SwPosition aPosition( pDstTxtFld->GetTxtNode() );
             aPosition.nContent = *pDstTxtFld->GetStart();
 
-            SwUndo *const pUndo( new SwUndoFieldFromDoc(
-                        aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
+            SwUndo *const pUndo( new SwUndoFieldFromDoc( aPosition, *pDstFld, rSrcFld, pMsgHnt, bUpdateFlds) );
             GetIDocumentUndoRedo().AppendUndo(pUndo);
         }
 
-        // Das gefundene Feld wird angepasst ...
-        //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
-        //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
-
         SwField * pNewFld = rSrcFld.CopyField();
-        pDstFmtFld->SetFld(pNewFld);
+        pDstFmtFld->SetField(pNewFld);
 
         switch( nFldWhich )
         {
@@ -2802,7 +2808,7 @@ bool SwDoc::PutValueToField(const SwPosi
                             const Any& rVal, sal_uInt16 nWhich)
 {
     Any aOldVal;
-    SwField * pField = GetField(rPos);
+    SwField * pField = GetFieldAtPos(rPos);
 
 
     if (GetIDocumentUndoRedo().DoesUndo() &&

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docfmt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docfmt.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docfmt.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docfmt.cxx Tue Nov 19 22:39:40 2013
@@ -164,35 +164,35 @@ struct ParaRstFmt
 
 sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
 {
-	ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
-	SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
-	if( pTxtNode && pTxtNode->GetpSwpHints() )
-	{
-		SwIndex aSt( pTxtNode, 0 );
-		sal_uInt16 nEnd = pTxtNode->Len();
+    ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
+    SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
+    if( pTxtNode && pTxtNode->GetpSwpHints() )
+    {
+        SwIndex aSt( pTxtNode, 0 );
+        sal_uInt16 nEnd = pTxtNode->Len();
 
-		if( &pPara->pSttNd->nNode.GetNode() == pTxtNode &&
-			pPara->pSttNd->nContent.GetIndex() )
-			aSt = pPara->pSttNd->nContent.GetIndex();
+        if( &pPara->pSttNd->nNode.GetNode() == pTxtNode &&
+            pPara->pSttNd->nContent.GetIndex() )
+            aSt = pPara->pSttNd->nContent.GetIndex();
 
-		if( &pPara->pEndNd->nNode.GetNode() == rpNd )
-			nEnd = pPara->pEndNd->nContent.GetIndex();
+        if( &pPara->pEndNd->nNode.GetNode() == rpNd )
+            nEnd = pPara->pEndNd->nContent.GetIndex();
 
-		if( pPara->pHistory )
-		{
-			// fuers Undo alle Attribute sichern
+        if( pPara->pHistory )
+        {
+            // fuers Undo alle Attribute sichern
             SwRegHistory aRHst( *pTxtNode, pPara->pHistory );
-			pTxtNode->GetpSwpHints()->Register( &aRHst );
-			pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
-								pPara->pDelSet, pPara->bInclRefToxMark );
-			if( pTxtNode->GetpSwpHints() )
-				pTxtNode->GetpSwpHints()->DeRegister();
-		}
-		else
-			pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
-								pPara->pDelSet, pPara->bInclRefToxMark );
-	}
-	return sal_True;
+            pTxtNode->GetpSwpHints()->Register( &aRHst );
+            pTxtNode->RstTxtAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
+                                  pPara->pDelSet, pPara->bInclRefToxMark );
+            if( pTxtNode->GetpSwpHints() )
+                pTxtNode->GetpSwpHints()->DeRegister();
+        }
+        else
+            pTxtNode->RstTxtAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich,
+                                  pPara->pDelSet, pPara->bInclRefToxMark );
+    }
+    return sal_True;
 }
 
 sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
@@ -399,7 +399,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg
         if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
 		{
 			nMkPos = *pURLAttr->GetStart();
-			nPtPos = *pURLAttr->GetEnd();
+			nPtPos = *pURLAttr->End();
 		}
 		else
 		{
@@ -549,13 +549,17 @@ void SwDoc::ResetAttrs( const SwPaM &rRg
 // Einfuegen der Hints nach Inhaltsformen;
 // wird in SwDoc::Insert(..., SwFmtHint &rHt) benutzt
 
-static bool
-lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
-//Modify here for #119405, by easyfan, 2012-05-24
-            const SetAttrMode nFlags, SwUndoAttr *const pUndo,bool bExpandCharToPara=false)
-//End of modification, by easyfan
+static bool lcl_InsAttr(
+    SwDoc *const pDoc,
+    const SwPaM &rRg,
+    const SfxItemSet& rChgSet,
+    const SetAttrMode nFlags,
+    SwUndoAttr *const pUndo,
+    //Modify here for #119405, by easyfan, 2012-05-24
+    const bool bExpandCharToPara=false)
+    //End of modification, by easyfan
 {
-	// teil die Sets auf (fuer Selektion in Nodes)
+    // teil die Sets auf (fuer Selektion in Nodes)
     const SfxItemSet* pCharSet = 0;
     const SfxItemSet* pOtherSet = 0;
     bool bDelete = false;
@@ -609,9 +613,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
 
         SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(),
                                     RES_PARATR_BEGIN, RES_PARATR_END-1,
-                                    // --> OD 2008-02-25 #refactorlists#
                                     RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
-                                    // <--
                                     RES_FRMATR_BEGIN, RES_FRMATR_END-1,
                                     RES_GRFATR_BEGIN, RES_GRFATR_END-1,
                                     RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -628,18 +630,17 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
 
     SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : 0;
     bool bRet = false;
-	const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
-	SwCntntNode* pNode = pStt->nNode.GetNode().GetCntntNode();
+    const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End();
+    SwCntntNode* pNode = pStt->nNode.GetNode().GetCntntNode();
 
-	if( pNode && pNode->IsTxtNode() )
-	{
+    if( pNode && pNode->IsTxtNode() )
+    {
         // -> #i27615#
         if (rRg.IsInFrontOfLabel())
         {
             SwTxtNode * pTxtNd = pNode->GetTxtNode();
             SwNumRule * pNumRule = pTxtNd->GetNumRule();
 
-            // --> OD 2005-10-24 #126346# - make code robust:
             if ( !pNumRule )
             {
                 ASSERT( false,
@@ -647,7 +648,6 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
                 DELETECHARSETS
                 return false;
             }
-            // <--
 
             SwNumFmt aNumFmt = pNumRule->Get(static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()));
             SwCharFmt * pCharFmt =
@@ -665,18 +665,17 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
             DELETECHARSETS
             return true;
         }
-        // <- #i27615#
 
-		const SwIndex& rSt = pStt->nContent;
+        const SwIndex& rSt = pStt->nContent;
 
-		// Attribute ohne Ende haben keinen Bereich
+        // Attribute ohne Ende haben keinen Bereich
         if ( !bCharAttr && !bOtherAttr )
         {
             SfxItemSet aTxtSet( pDoc->GetAttrPool(),
-						RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1 );
-			aTxtSet.Put( rChgSet );
-			if( aTxtSet.Count() )
-			{
+                        RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1 );
+            aTxtSet.Put( rChgSet );
+            if( aTxtSet.Count() )
+            {
                 SwRegHistory history( pNode, *pNode, pHistory );
                 bRet = history.InsertItems(
                     aTxtSet, rSt.GetIndex(), rSt.GetIndex(), nFlags ) || bRet;
@@ -684,39 +683,40 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
                 if (bRet && (pDoc->IsRedlineOn() || (!pDoc->IsIgnoreRedline()
                                 && pDoc->GetRedlineTbl().Count())))
                 {
-					SwPaM aPam( pStt->nNode, pStt->nContent.GetIndex()-1,
-								pStt->nNode, pStt->nContent.GetIndex() );
+                    SwPaM aPam( pStt->nNode, pStt->nContent.GetIndex()-1,
+                                pStt->nNode, pStt->nContent.GetIndex() );
 
-					if( pUndo )
-						pUndo->SaveRedlineData( aPam, sal_True );
+                    if( pUndo )
+                        pUndo->SaveRedlineData( aPam, sal_True );
 
-					if( pDoc->IsRedlineOn() )
-						pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true);
-					else
-						pDoc->SplitRedline( aPam );
-				}
-			}
-		}
+                    if( pDoc->IsRedlineOn() )
+                        pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true);
+                    else
+                        pDoc->SplitRedline( aPam );
+                }
+            }
+        }
 
-		// TextAttribute mit Ende expandieren nie ihren Bereich
-		if ( !bCharAttr && !bOtherAttr )
+        // TextAttribute mit Ende expandieren nie ihren Bereich
+        if ( !bCharAttr && !bOtherAttr )
         {
-			// CharFmt wird gesondert behandelt !!!
-			// JP 22.08.96: URL-Attribute auch!!
+            // CharFmt wird gesondert behandelt !!!
+            // JP 22.08.96: URL-Attribute auch!!
             // TEST_TEMP ToDo: AutoFmt!
-			SfxItemSet aTxtSet( pDoc->GetAttrPool(),
+            SfxItemSet aTxtSet( pDoc->GetAttrPool(),
                                 RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK,
                                 RES_TXTATR_META, RES_TXTATR_METAFIELD,
                                 RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
-								0 );
+                                RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD,
+                                0 );
 
-			aTxtSet.Put( rChgSet );
-			if( aTxtSet.Count() )
-			{
-				sal_uInt16 nInsCnt = rSt.GetIndex();
-				sal_uInt16 nEnd = pStt->nNode == pEnd->nNode
-								? pEnd->nContent.GetIndex()
-								: pNode->Len();
+            aTxtSet.Put( rChgSet );
+            if( aTxtSet.Count() )
+            {
+                sal_uInt16 nInsCnt = rSt.GetIndex();
+                sal_uInt16 nEnd = pStt->nNode == pEnd->nNode
+                                ? pEnd->nContent.GetIndex()
+                                : pNode->Len();
                 SwRegHistory history( pNode, *pNode, pHistory );
                 bRet = history.InsertItems( aTxtSet, nInsCnt, nEnd, nFlags )
                     || bRet;
@@ -724,51 +724,51 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
                 if (bRet && (pDoc->IsRedlineOn() || (!pDoc->IsIgnoreRedline()
                                 && pDoc->GetRedlineTbl().Count())))
                 {
-					// wurde Text-Inhalt eingefuegt? (RefMark/TOXMarks ohne Ende)
-					sal_Bool bTxtIns = nInsCnt != rSt.GetIndex();
-					// wurde Inhalt eingefuegt oder ueber die Selektion gesetzt?
-					SwPaM aPam( pStt->nNode, bTxtIns ? nInsCnt + 1 : nEnd,
-								pStt->nNode, nInsCnt );
-					if( pUndo )
-						pUndo->SaveRedlineData( aPam, bTxtIns );
-
-					if( pDoc->IsRedlineOn() )
-						pDoc->AppendRedline( new SwRedline( bTxtIns
-								? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_FORMAT, aPam ), true);
-					else if( bTxtIns )
-						pDoc->SplitRedline( aPam );
-				}
-			}
-		}
-	}
+                    // wurde Text-Inhalt eingefuegt? (RefMark/TOXMarks ohne Ende)
+                    sal_Bool bTxtIns = nInsCnt != rSt.GetIndex();
+                    // wurde Inhalt eingefuegt oder ueber die Selektion gesetzt?
+                    SwPaM aPam( pStt->nNode, bTxtIns ? nInsCnt + 1 : nEnd,
+                                pStt->nNode, nInsCnt );
+                    if( pUndo )
+                        pUndo->SaveRedlineData( aPam, bTxtIns );
+
+                    if( pDoc->IsRedlineOn() )
+                        pDoc->AppendRedline( new SwRedline( bTxtIns
+                                ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_FORMAT, aPam ), true);
+                    else if( bTxtIns )
+                        pDoc->SplitRedline( aPam );
+                }
+            }
+        }
+    }
 
-	// bei PageDesc's, die am Node gesetzt werden, muss immer das
-	// Auto-Flag gesetzt werden!!
+    // bei PageDesc's, die am Node gesetzt werden, muss immer das
+    // Auto-Flag gesetzt werden!!
     if( pOtherSet && pOtherSet->Count() )
-	{
-		SwTableNode* pTblNd;
-		const SwFmtPageDesc* pDesc;
+    {
+        SwTableNode* pTblNd;
+        const SwFmtPageDesc* pDesc;
         if( SFX_ITEM_SET == pOtherSet->GetItemState( RES_PAGEDESC,
-						sal_False, (const SfxPoolItem**)&pDesc ))
-		{
-			if( pNode )
-			{
-				// Auto-Flag setzen, nur in Vorlagen ist ohne Auto !
-				SwFmtPageDesc aNew( *pDesc );
-				// Bug 38479: AutoFlag wird jetzt in der WrtShell gesetzt
-				// aNew.SetAuto();
-
-				// Tabellen kennen jetzt auch Umbrueche
-				if( 0 == (nFlags & nsSetAttrMode::SETATTR_APICALL) &&
-					0 != ( pTblNd = pNode->FindTableNode() ) )
-				{
+                        sal_False, (const SfxPoolItem**)&pDesc ))
+        {
+            if( pNode )
+            {
+                // Auto-Flag setzen, nur in Vorlagen ist ohne Auto !
+                SwFmtPageDesc aNew( *pDesc );
+                // Bug 38479: AutoFlag wird jetzt in der WrtShell gesetzt
+                // aNew.SetAuto();
+
+                // Tabellen kennen jetzt auch Umbrueche
+                if( 0 == (nFlags & nsSetAttrMode::SETATTR_APICALL) &&
+                    0 != ( pTblNd = pNode->FindTableNode() ) )
+                {
                     SwTableNode* pCurTblNd = pTblNd;
                     while ( 0 != ( pCurTblNd = pCurTblNd->StartOfSectionNode()->FindTableNode() ) )
                         pTblNd = pCurTblNd;
 
-					// dann am Tabellen Format setzen
-					SwFrmFmt* pFmt = pTblNd->GetTable().GetFrmFmt();
-					SwRegHistory aRegH( pFmt, *pTblNd, pHistory );
+                    // dann am Tabellen Format setzen
+                    SwFrmFmt* pFmt = pTblNd->GetTable().GetFrmFmt();
+                    SwRegHistory aRegH( pFmt, *pTblNd, pHistory );
                     pFmt->SetFmtAttr( aNew );
                     bRet = true;
                 }
@@ -793,20 +793,20 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
             }
         }
 
-		// Tabellen kennen jetzt auch Umbrueche
-		const SvxFmtBreakItem* pBreak;
-		if( pNode && 0 == (nFlags & nsSetAttrMode::SETATTR_APICALL) &&
-			0 != (pTblNd = pNode->FindTableNode() ) &&
+        // Tabellen kennen jetzt auch Umbrueche
+        const SvxFmtBreakItem* pBreak;
+        if( pNode && 0 == (nFlags & nsSetAttrMode::SETATTR_APICALL) &&
+            0 != (pTblNd = pNode->FindTableNode() ) &&
             SFX_ITEM_SET == pOtherSet->GetItemState( RES_BREAK,
-						sal_False, (const SfxPoolItem**)&pBreak ) )
-		{
+                        sal_False, (const SfxPoolItem**)&pBreak ) )
+        {
             SwTableNode* pCurTblNd = pTblNd;
             while ( 0 != ( pCurTblNd = pCurTblNd->StartOfSectionNode()->FindTableNode() ) )
                 pTblNd = pCurTblNd;
 
-			// dann am Tabellen Format setzen
-			SwFrmFmt* pFmt = pTblNd->GetTable().GetFrmFmt();
-			SwRegHistory aRegH( pFmt, *pTblNd, pHistory );
+            // dann am Tabellen Format setzen
+            SwFrmFmt* pFmt = pTblNd->GetTable().GetFrmFmt();
+            SwRegHistory aRegH( pFmt, *pTblNd, pHistory );
             pFmt->SetFmtAttr( *pBreak );
             bRet = true;
 
@@ -824,129 +824,129 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
             }
         }
 
-		{
-			// wenns eine PoolNumRule ist, diese ggfs. anlegen
-			const SwNumRuleItem* pRule;
-			sal_uInt16 nPoolId;
+        {
+            // wenns eine PoolNumRule ist, diese ggfs. anlegen
+            const SwNumRuleItem* pRule;
+            sal_uInt16 nPoolId;
             if( SFX_ITEM_SET == pOtherSet->GetItemState( RES_PARATR_NUMRULE,
-								sal_False, (const SfxPoolItem**)&pRule ) &&
-				!pDoc->FindNumRulePtr( pRule->GetValue() ) &&
-				USHRT_MAX != (nPoolId = SwStyleNameMapper::GetPoolIdFromUIName ( pRule->GetValue(),
-								nsSwGetPoolIdFromName::GET_POOLID_NUMRULE )) )
-				pDoc->GetNumRuleFromPool( nPoolId );
-		}
+                                sal_False, (const SfxPoolItem**)&pRule ) &&
+                !pDoc->FindNumRulePtr( pRule->GetValue() ) &&
+                USHRT_MAX != (nPoolId = SwStyleNameMapper::GetPoolIdFromUIName ( pRule->GetValue(),
+                                nsSwGetPoolIdFromName::GET_POOLID_NUMRULE )) )
+                pDoc->GetNumRuleFromPool( nPoolId );
+        }
 
-	}
+    }
 
-	if( !rRg.HasMark() )		// kein Bereich
-	{
-		if( !pNode )
+    if( !rRg.HasMark() )		// kein Bereich
+    {
+        if( !pNode )
         {
             DELETECHARSETS
-			return bRet;
+            return bRet;
         }
 
         if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() )
         {
             SwTxtNode* pTxtNd = static_cast<SwTxtNode*>(pNode);
-			const SwIndex& rSt = pStt->nContent;
-			sal_uInt16 nMkPos, nPtPos = rSt.GetIndex();
-			const String& rStr = pTxtNd->GetTxt();
+            const SwIndex& rSt = pStt->nContent;
+            sal_uInt16 nMkPos, nPtPos = rSt.GetIndex();
+            const String& rStr = pTxtNd->GetTxt();
 
-			// JP 22.08.96: Sonderfall: steht der Crsr in einem URL-Attribut
-			//				dann wird dessen Bereich genommen
+            // JP 22.08.96: Sonderfall: steht der Crsr in einem URL-Attribut
+            //				dann wird dessen Bereich genommen
             SwTxtAttr const*const pURLAttr(
                 pTxtNd->GetTxtAttrAt(rSt.GetIndex(), RES_TXTATR_INETFMT));
             if (pURLAttr && pURLAttr->GetINetFmt().GetValue().Len())
-			{
-				nMkPos = *pURLAttr->GetStart();
-				nPtPos = *pURLAttr->GetEnd();
-			}
-			else
-			{
-				Boundary aBndry;
-				if( pBreakIt->GetBreakIter().is() )
-					aBndry = pBreakIt->GetBreakIter()->getWordBoundary(
-								pTxtNd->GetTxt(), nPtPos,
-								pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
-								WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
-								sal_True );
+            {
+                nMkPos = *pURLAttr->GetStart();
+                nPtPos = *pURLAttr->End();
+            }
+            else
+            {
+                Boundary aBndry;
+                if( pBreakIt->GetBreakIter().is() )
+                    aBndry = pBreakIt->GetBreakIter()->getWordBoundary(
+                                pTxtNd->GetTxt(), nPtPos,
+                                pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ),
+                                WordType::ANY_WORD /*ANYWORD_IGNOREWHITESPACES*/,
+                                sal_True );
 
-				if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
-				{
-					nMkPos = (xub_StrLen)aBndry.startPos;
-					nPtPos = (xub_StrLen)aBndry.endPos;
-				}
-				else
-					nPtPos = nMkPos = rSt.GetIndex();
-			}
+                if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos )
+                {
+                    nMkPos = (xub_StrLen)aBndry.startPos;
+                    nPtPos = (xub_StrLen)aBndry.endPos;
+                }
+                else
+                    nPtPos = nMkPos = rSt.GetIndex();
+            }
 
-			// erstmal die zu ueberschreibenden Attribute aus dem
-			// SwpHintsArray entfernen, wenn die Selektion den gesamten
-			// Absatz umspannt. (Diese Attribute werden als FormatAttr.
-			// eingefuegt und verdraengen nie die TextAttr.!)
-			if( !(nFlags & nsSetAttrMode::SETATTR_DONTREPLACE ) &&
-				pTxtNd->HasHints() && !nMkPos && nPtPos == rStr.Len() )
-			{
-				SwIndex aSt( pTxtNd );
-				if( pHistory )
-				{
-					// fuers Undo alle Attribute sichern
-					SwRegHistory aRHst( *pTxtNd, pHistory );
-					pTxtNd->GetpSwpHints()->Register( &aRHst );
-                    pTxtNd->RstAttr( aSt, nPtPos, 0, pCharSet );
-					if( pTxtNd->GetpSwpHints() )
-						pTxtNd->GetpSwpHints()->DeRegister();
-				}
+            // erstmal die zu ueberschreibenden Attribute aus dem
+            // SwpHintsArray entfernen, wenn die Selektion den gesamten
+            // Absatz umspannt. (Diese Attribute werden als FormatAttr.
+            // eingefuegt und verdraengen nie die TextAttr.!)
+            if( !(nFlags & nsSetAttrMode::SETATTR_DONTREPLACE ) &&
+                pTxtNd->HasHints() && !nMkPos && nPtPos == rStr.Len() )
+            {
+                SwIndex aSt( pTxtNd );
+                if( pHistory )
+                {
+                    // fuers Undo alle Attribute sichern
+                    SwRegHistory aRHst( *pTxtNd, pHistory );
+                    pTxtNd->GetpSwpHints()->Register( &aRHst );
+                    pTxtNd->RstTxtAttr( aSt, nPtPos, 0, pCharSet );
+                    if( pTxtNd->GetpSwpHints() )
+                        pTxtNd->GetpSwpHints()->DeRegister();
+                }
                 else
-                    pTxtNd->RstAttr( aSt, nPtPos, 0, pCharSet );
-			}
+                    pTxtNd->RstTxtAttr( aSt, nPtPos, 0, pCharSet );
+            }
 
             // the SwRegHistory inserts the attribute into the TxtNode!
             SwRegHistory history( pNode, *pNode, pHistory );
             bRet = history.InsertItems( *pCharSet, nMkPos, nPtPos, nFlags )
                 || bRet;
 
-			if( pDoc->IsRedlineOn() )
-			{
-				SwPaM aPam( *pNode, nMkPos, *pNode, nPtPos );
+            if( pDoc->IsRedlineOn() )
+            {
+                SwPaM aPam( *pNode, nMkPos, *pNode, nPtPos );
 
-				if( pUndo )
-					pUndo->SaveRedlineData( aPam, sal_False );
-				pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, aPam ), true);
-			}
-		}
+                if( pUndo )
+                    pUndo->SaveRedlineData( aPam, sal_False );
+                pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, aPam ), true);
+            }
+        }
         if( pOtherSet && pOtherSet->Count() )
-		{
-			SwRegHistory aRegH( pNode, *pNode, pHistory );
+        {
+            SwRegHistory aRegH( pNode, *pNode, pHistory );
             bRet = pNode->SetAttr( *pOtherSet ) || bRet;
         }
 
         DELETECHARSETS
-		return bRet;
-	}
+        return bRet;
+    }
 
     if( pDoc->IsRedlineOn() && pCharSet && pCharSet->Count() )
-	{
-		if( pUndo )
-			pUndo->SaveRedlineData( rRg, sal_False );
-		pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, rRg ), true);
-	}
+    {
+        if( pUndo )
+            pUndo->SaveRedlineData( rRg, sal_False );
+        pDoc->AppendRedline( new SwRedline( nsRedlineType_t::REDLINE_FORMAT, rRg ), true);
+    }
 
-	/* jetzt wenn Bereich */
-	sal_uLong nNodes = 0;
+    /* jetzt wenn Bereich */
+    sal_uLong nNodes = 0;
 
-	SwNodeIndex aSt( pDoc->GetNodes() );
-	SwNodeIndex aEnd( pDoc->GetNodes() );
-	SwIndex aCntEnd( pEnd->nContent );
+    SwNodeIndex aSt( pDoc->GetNodes() );
+    SwNodeIndex aEnd( pDoc->GetNodes() );
+    SwIndex aCntEnd( pEnd->nContent );
 
-	if( pNode )
-	{
-		sal_uInt16 nLen = pNode->Len();
-		if( pStt->nNode != pEnd->nNode )
-			aCntEnd.Assign( pNode, nLen );
+    if( pNode )
+    {
+        sal_uInt16 nLen = pNode->Len();
+        if( pStt->nNode != pEnd->nNode )
+            aCntEnd.Assign( pNode, nLen );
 
-		if( pStt->nContent.GetIndex() != 0 || aCntEnd.GetIndex() != nLen )
+        if( pStt->nContent.GetIndex() != 0 || aCntEnd.GetIndex() != nLen )
         {
             // the SwRegHistory inserts the attribute into the TxtNode!
             if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() )
@@ -958,59 +958,59 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
             }
 
             if( pOtherSet && pOtherSet->Count() )
-			{
-				SwRegHistory aRegH( pNode, *pNode, pHistory );
+            {
+                SwRegHistory aRegH( pNode, *pNode, pHistory );
                 bRet = pNode->SetAttr( *pOtherSet ) || bRet;
             }
 
-			// lediglich Selektion in einem Node.
-			if( pStt->nNode == pEnd->nNode )
+            // lediglich Selektion in einem Node.
+            if( pStt->nNode == pEnd->nNode )
             {
-			//Modify here for #119405, by easyfan, 2012-05-24
-			//The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
-			//Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that 
-			//current setting attribute set is a character range properties set and comes from a MS word 
-			//binary file, And the setting range include a paragraph end position (0X0D);
-			//More specifications, as such property inside the character range properties set recorded in
-			//MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we 
-			//only dealing the scenario that the char properties set with 1 item inside;
-			
-            		if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1 )
-			{
-				SwTxtNode* pCurrentNd = pStt->nNode.GetNode().GetTxtNode();
-				
-				if (pCurrentNd)
-				{
-	 				pCurrentNd->TryCharSetExpandToNum(*pCharSet);
-						
-				}
-			}
-			//End of modification, by easyfan
+            //Modify here for #119405, by easyfan, 2012-05-24
+            //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
+            //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that 
+            //current setting attribute set is a character range properties set and comes from a MS word 
+            //binary file, And the setting range include a paragraph end position (0X0D);
+            //More specifications, as such property inside the character range properties set recorded in
+            //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we 
+            //only dealing the scenario that the char properties set with 1 item inside;
+            
+                    if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1 )
+            {
+                SwTxtNode* pCurrentNd = pStt->nNode.GetNode().GetTxtNode();
+                
+                if (pCurrentNd)
+                {
+                    pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+                        
+                }
+            }
+            //End of modification, by easyfan
                 DELETECHARSETS
                 return bRet;
             }
-			++nNodes;
-			aSt.Assign( pStt->nNode.GetNode(), +1 );
-		}
-		else
-			aSt = pStt->nNode;
-		aCntEnd = pEnd->nContent; // aEnd wurde veraendert !!
-	}
-	else
-		aSt.Assign( pStt->nNode.GetNode(), +1 );
+            ++nNodes;
+            aSt.Assign( pStt->nNode.GetNode(), +1 );
+        }
+        else
+            aSt = pStt->nNode;
+        aCntEnd = pEnd->nContent; // aEnd wurde veraendert !!
+    }
+    else
+        aSt.Assign( pStt->nNode.GetNode(), +1 );
 
-	// aSt zeigt jetzt auf den ersten vollen Node
+    // aSt zeigt jetzt auf den ersten vollen Node
 
-	/*
-	 * die Selektion umfasst mehr als einen Node
-	 */
-	if( pStt->nNode < pEnd->nNode )
-	{
-		pNode = pEnd->nNode.GetNode().GetCntntNode();
-		if(pNode)
-		{
-			sal_uInt16 nLen = pNode->Len();
-			if( aCntEnd.GetIndex() != nLen )
+    /*
+     * die Selektion umfasst mehr als einen Node
+     */
+    if( pStt->nNode < pEnd->nNode )
+    {
+        pNode = pEnd->nNode.GetNode().GetCntntNode();
+        if(pNode)
+        {
+            sal_uInt16 nLen = pNode->Len();
+            if( aCntEnd.GetIndex() != nLen )
             {
                 // the SwRegHistory inserts the attribute into the TxtNode!
                 if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() )
@@ -1021,136 +1021,134 @@ lcl_InsAttr(SwDoc *const pDoc, const SwP
                 }
 
                 if( pOtherSet && pOtherSet->Count() )
-				{
-					SwRegHistory aRegH( pNode, *pNode, pHistory );
+                {
+                    SwRegHistory aRegH( pNode, *pNode, pHistory );
                     pNode->SetAttr( *pOtherSet );
-				}
+                }
 
-				++nNodes;
-				aEnd = pEnd->nNode;
-			}
-			else
-				aEnd.Assign( pEnd->nNode.GetNode(), +1 );
-		}
-		else
-			aEnd = pEnd->nNode;
-	}
-	else
-		aEnd.Assign( pEnd->nNode.GetNode(), +1 );
+                ++nNodes;
+                aEnd = pEnd->nNode;
+            }
+            else
+                aEnd.Assign( pEnd->nNode.GetNode(), +1 );
+        }
+        else
+            aEnd = pEnd->nNode;
+    }
+    else
+        aEnd.Assign( pEnd->nNode.GetNode(), +1 );
 
-	// aEnd zeigt jetzt HINTER den letzten voll Node
+    // aEnd zeigt jetzt HINTER den letzten voll Node
 
-	/* Bearbeitung der vollstaendig selektierten Nodes. */
+    /* Bearbeitung der vollstaendig selektierten Nodes. */
 // alle Attribute aus dem Set zuruecksetzen !!
     if( pCharSet && pCharSet->Count() && !( nsSetAttrMode::SETATTR_DONTREPLACE & nFlags ) )
-	{
+    {
 
         ParaRstFmt aPara( pStt, pEnd, pHistory, 0, pCharSet );
-		pDoc->GetNodes().ForEach( aSt, aEnd, lcl_RstTxtAttr, &aPara );
-	}
+        pDoc->GetNodes().ForEach( aSt, aEnd, lcl_RstTxtAttr, &aPara );
+    }
 
     sal_Bool bCreateSwpHints = pCharSet && (
         SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, sal_False ) ||
         SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, sal_False ) );
 
-	for(; aSt < aEnd; aSt++ )
-	{
-		pNode = aSt.GetNode().GetCntntNode();
-		if( !pNode )
-			continue;
+    for(; aSt < aEnd; aSt++ )
+    {
+        pNode = aSt.GetNode().GetCntntNode();
+        if( !pNode )
+            continue;
 
-		SwTxtNode* pTNd = pNode->GetTxtNode();
-		if( pHistory )
-		{
-			SwRegHistory aRegH( pNode, *pNode, pHistory );
-			SwpHints *pSwpHints;
+        SwTxtNode* pTNd = pNode->GetTxtNode();
+        if( pHistory )
+        {
+            SwRegHistory aRegH( pNode, *pNode, pHistory );
+            SwpHints *pSwpHints;
 
             if( pTNd && pCharSet && pCharSet->Count() )
-			{
-				pSwpHints = bCreateSwpHints ? &pTNd->GetOrCreateSwpHints()
-											: pTNd->GetpSwpHints();
-				if( pSwpHints )
-					pSwpHints->Register( &aRegH );
+            {
+                pSwpHints = bCreateSwpHints ? &pTNd->GetOrCreateSwpHints()
+                                            : pTNd->GetpSwpHints();
+                if( pSwpHints )
+                    pSwpHints->Register( &aRegH );
 
                 pTNd->SetAttr( *pCharSet, 0, pTNd->GetTxt().Len(), nFlags );
-				if( pSwpHints )
-					pSwpHints->DeRegister();
-			}
+                if( pSwpHints )
+                    pSwpHints->DeRegister();
+            }
             if( pOtherSet && pOtherSet->Count() )
                 pNode->SetAttr( *pOtherSet );
-		}
-		else
-		{
+        }
+        else
+        {
             if( pTNd && pCharSet && pCharSet->Count() )
                 pTNd->SetAttr( *pCharSet, 0, pTNd->GetTxt().Len(), nFlags );
             if( pOtherSet && pOtherSet->Count() )
                 pNode->SetAttr( *pOtherSet );
-		}
-		++nNodes;
-	}
+        }
+        ++nNodes;
+    }
 
-	//Modify here for #119405, by easyfan, 2012-05-24
-	//The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
-	//Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that 
-	//current setting attribute set is a character range properties set and comes from a MS word 
-	//binary file, And the setting range include a paragraph end position (0X0D);
-	//More specifications, as such property inside the character range properties set recorded in
-	//MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we 
-	//only dealing the scenario that the char properties set with 1 item inside;
-	if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1)
-	{
-		SwPosition aStartPos (*rRg.Start());
-		SwPosition aEndPos (*rRg.End());
-
-		if (aEndPos.nNode.GetNode().GetTxtNode() && aEndPos.nContent != aEndPos.nNode.GetNode().GetTxtNode()->Len())
-			aEndPos.nNode--;
-
-		for (;aStartPos<=aEndPos;aStartPos.nNode++)
-		{
-			SwTxtNode* pCurrentNd = aStartPos.nNode.GetNode().GetTxtNode();
-			
-			if (pCurrentNd)
-			{
- 				pCurrentNd->TryCharSetExpandToNum(*pCharSet);
-					
-			}
-				
-		}
-	}
-	//End of modification, by easyfan
+    //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc,
+    //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that 
+    //current setting attribute set is a character range properties set and comes from a MS word 
+    //binary file, And the setting range include a paragraph end position (0X0D);
+    //More specifications, as such property inside the character range properties set recorded in
+    //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we 
+    //only dealing the scenario that the char properties set with 1 item inside;
+    if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1)
+    {
+        SwPosition aStartPos (*rRg.Start());
+        SwPosition aEndPos (*rRg.End());
+
+        if (aEndPos.nNode.GetNode().GetTxtNode() && aEndPos.nContent != aEndPos.nNode.GetNode().GetTxtNode()->Len())
+            aEndPos.nNode--;
+
+        for (;aStartPos<=aEndPos;aStartPos.nNode++)
+        {
+            SwTxtNode* pCurrentNd = aStartPos.nNode.GetNode().GetTxtNode();
+            
+            if (pCurrentNd)
+            {
+                pCurrentNd->TryCharSetExpandToNum(*pCharSet);
+                    
+            }
+                
+        }
+    }
 
     DELETECHARSETS
     return (nNodes != 0) || bRet;
 }
 
-//Modify here for #119405, by chengjh, 2012-08-16
-//Add a para for the char attribute exp...
-bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt,
-                            const SetAttrMode nFlags, bool bExpandCharToPara)
-//End
+bool SwDoc::InsertPoolItem(
+    const SwPaM &rRg,
+    const SfxPoolItem &rHt,
+    const SetAttrMode nFlags,
+    const bool bExpandCharToPara)
 {
-	SwDataChanged aTmp( rRg, 0 );
-	SwUndoAttr* pUndoAttr = 0;
+    SwDataChanged aTmp( rRg, 0 );
+    SwUndoAttr* pUndoAttr = 0;
     if (GetIDocumentUndoRedo().DoesUndo())
     {
         GetIDocumentUndoRedo().ClearRedo();
-		pUndoAttr = new SwUndoAttr( rRg, rHt, nFlags );
-	}
+        pUndoAttr = new SwUndoAttr( rRg, rHt, nFlags );
+    }
 
-	SfxItemSet aSet( GetAttrPool(), rHt.Which(), rHt.Which() );
-	aSet.Put( rHt );
-	//Modify here for #119405, by easyfan, 2012-05-24    	
-    	bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara );
-    	//End of modification, by easyfan
+    SfxItemSet aSet( GetAttrPool(), rHt.Which(), rHt.Which() );
+    aSet.Put( rHt );
+    const bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara );
 
     if (GetIDocumentUndoRedo().DoesUndo())
     {
         GetIDocumentUndoRedo().AppendUndo( pUndoAttr );
     }
 
-	if( bRet )
-		SetModified();
-	return bRet;
+    if( bRet )
+    {
+        SetModified();
+    }
+    return bRet;
 }
 
 bool SwDoc::InsertItemSet ( const SwPaM &rRg, const SfxItemSet &rSet,

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docnum.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docnum.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docnum.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docnum.cxx Tue Nov 19 22:39:40 2013
@@ -1011,7 +1011,6 @@ void SwDoc::SetNumRule( const SwPaM& rPa
         }
     }
 
-    // --> OD 2008-03-17 #refactorlists#
     if ( bSetItem )
     {
         if ( bCreateNewList )
@@ -1030,22 +1029,18 @@ void SwDoc::SetNumRule( const SwPaM& rPa
                         "<SwDoc::SetNumRule(..)> - could not create new list. Serious defect -> please inform OD." );
                 sListId = pNewList->GetListId();
             }
-            InsertPoolItem( rPam,
-                SfxStringItem( RES_PARATR_LIST_ID, sListId ), 0 );
+            InsertPoolItem( rPam, SfxStringItem( RES_PARATR_LIST_ID, sListId ), 0 );
         }
         else if ( sContinuedListId.Len() > 0 )
         {
             // apply given list id
-            InsertPoolItem( rPam,
-                SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
+            InsertPoolItem( rPam, SfxStringItem( RES_PARATR_LIST_ID, sContinuedListId ), 0 );
         }
     }
-    // <--
 
     if ( ! rPam.HasMark())
     {
         SwTxtNode * pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode();
-        // --> OD 2006-10-19 #134160#
         // consider case that the PaM doesn't denote a text node - e.g. it denotes a graphic node
         if ( pTxtNd )
         {
@@ -1054,15 +1049,13 @@ void SwDoc::SetNumRule( const SwPaM& rPa
             if (pRule && pRule->GetName() == pNew->GetName())
             {
                 bSetItem = sal_False;
-                // --> OD 2008-06-02 #refactorlists#
                 if ( !pTxtNd->IsInList() )
                 {
                     pTxtNd->AddToList();
                 }
-                // <--
             }
-            // --> OD 2005-10-26 #b6340308# - only clear numbering attribute at
-            // text node, if at paragraph style the new numbering rule is found.
+            // only clear numbering attribute at text node,
+            // if at paragraph style the new numbering rule is found.
             else if ( !pRule )
             {
                 SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
@@ -1076,25 +1069,19 @@ void SwDoc::SetNumRule( const SwPaM& rPa
                     }
                 }
             }
-            // <--
         }
-        // <--
     }
 
-    // --> OD 2009-08-18 #i103817#
     if ( bSetItem )
-    // <--
     {
         InsertPoolItem( rPam, SwNumRuleItem( pNew->GetName() ), 0 );
     }
 
-    // --> OD 2008-02-08 #newlistlevelattrs#
     if ( bResetIndentAttrs &&
          pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
     {
         SvUShortsSort aResetAttrsArray;
         aResetAttrsArray.Insert( RES_LR_SPACE );
-        // --> OD 2010-10-05 #i114929#
         // On a selection setup a corresponding Point-and-Mark in order to get
         // the indentation attribute reset on all paragraphs touched by the selection
         if ( rPam.HasMark() &&
@@ -1110,16 +1097,14 @@ void SwDoc::SetNumRule( const SwPaM& rPa
         {        
             ResetAttrs( rPam, sal_False, &aResetAttrsArray );
         }
-        // <--
     }
-    // <--
 
     if (GetIDocumentUndoRedo().DoesUndo())
     {
         GetIDocumentUndoRedo().EndUndo( UNDO_INSNUM, NULL );
     }
 
-	SetModified();
+    SetModified();
 }
 
 void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted)
@@ -1128,7 +1113,6 @@ void SwDoc::SetCounted(const SwPaM & rPa
     {
         SvUShortsSort aResetAttrsArray;
         aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
-        // --> OD 2010-10-05 #i114929#
         // On a selection setup a corresponding Point-and-Mark in order to get
         // the list-is-counted attribute reset on all paragraphs touched by the selection
         if ( rPam.HasMark() &&
@@ -1144,12 +1128,10 @@ void SwDoc::SetCounted(const SwPaM & rPa
         {        
             ResetAttrs( rPam, sal_False, &aResetAttrsArray );
         }
-        // <--
     }
     else
     {
-        InsertPoolItem( rPam,
-            SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_False ), 0 );
+        InsertPoolItem( rPam, SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, sal_False ), 0 );
     }
 }
 

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docredln.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docredln.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docredln.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docredln.cxx Tue Nov 19 22:39:40 2013
@@ -2973,19 +2973,19 @@ SwRedlineExtraData* SwRedlineExtraData_F
 
 void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
 {
-	SwDoc* pDoc = rPam.GetDoc();
+    SwDoc* pDoc = rPam.GetDoc();
 
-	RedlineMode_t eOld = pDoc->GetRedlineMode();
-	pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE)));
+    RedlineMode_t eOld = pDoc->GetRedlineMode();
+    pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE)));
 
-	// eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
-	for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
+    // eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
+    for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
     {
-        pDoc->InsertPoolItem( rPam, *GetDfltAttr( aWhichIds[ n ] ),
-                nsSetAttrMode::SETATTR_DONTEXPAND );
+        pDoc->InsertPoolItem(
+            rPam, *GetDfltAttr( aWhichIds[ n ] ), nsSetAttrMode::SETATTR_DONTEXPAND );
     }
 
-	pDoc->SetRedlineMode_intern( eOld );
+    pDoc->SetRedlineMode_intern( eOld );
 }
 
 int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/docruby.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/docruby.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/docruby.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/docruby.cxx Tue Nov 19 22:39:40 2013
@@ -173,8 +173,8 @@ sal_uInt16 SwDoc::SetRubyList( const SwP
                             InsertString( aPam, pEntry->GetText() );
 							aPam.SetMark();
 							aPam.GetMark()->nContent -= pEntry->GetText().Len();
-                            InsertPoolItem( aPam, pEntry->GetRubyAttr(),
-                                    nsSetAttrMode::SETATTR_DONTEXPAND );
+                            InsertPoolItem(
+                                aPam, pEntry->GetRubyAttr(), nsSetAttrMode::SETATTR_DONTEXPAND );
 						}
 						else
 							break;

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/doctxm.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/doctxm.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/doctxm.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/doctxm.cxx Tue Nov 19 22:39:40 2013
@@ -157,7 +157,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const S
 		if( ( nSttIdx = *pHt->GetStart() ) < nAktPos )
 		{
 			// pruefe Ende mit ab
-			if( 0 == ( pEndIdx = pHt->GetEnd() ) ||
+			if( 0 == ( pEndIdx = pHt->End() ) ||
 				*pEndIdx <= nAktPos )
 				continue;		// weiter suchen
 		}
@@ -262,7 +262,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( con
 	const SwTOXMark* pTOXMark;
 	const SwCntntFrm* pCFrm;
 	Point aPt;
-	for( sal_Int32 nMark=0; nMark<aMarks.Count(); nMark++ )
+	for( sal_uInt16 nMark=0; nMark<aMarks.Count(); nMark++ )
 	{
         pTOXMark = aMarks[nMark];
 		if( pTOXMark != &rCurTOXMark &&
@@ -2109,7 +2109,7 @@ void SwTOXBaseSection::_UpdatePageNum( S
 		for(sal_uInt16 nHintIdx = 0; nHintIdx < pHints->GetStartCount(); nHintIdx++)
 		{
 			SwTxtAttr* pAttr = pHints->GetStart(nHintIdx);
-			xub_StrLen nTmpEnd = pAttr->GetEnd() ? *pAttr->GetEnd() : 0;
+			const xub_StrLen nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
 			if(	nStartPos >= *pAttr->GetStart() &&
 				(nStartPos + 2) <= nTmpEnd &&
 				pAttr->Which() == RES_TXTATR_CHARFMT)

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/tblcpy.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/tblcpy.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/tblcpy.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/tblcpy.cxx Tue Nov 19 22:39:40 2013
@@ -1029,7 +1029,11 @@ sal_Bool SwTable::InsTable( const SwTabl
 
 	// loesche die Frames
 	aFndBox.SetTableLines( *this );
-	aFndBox.DelFrms( *this );
+	//IAccessibility2 Implementation 2009-----
+	//Solution:Not dispose accessible table
+	//aFndBox.DelFrms( *this );
+	aFndBox.DelFrms( *this,sal_False );
+	//-----IAccessibility2 Implementation 2009
 
 	if( 1 == rCpyTbl.GetTabSortBoxes().Count() )
 	{

Modified: openoffice/branches/l10n40/main/sw/source/core/doc/visiturl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/doc/visiturl.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/doc/visiturl.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/doc/visiturl.cxx Tue Nov 19 22:39:40 2013
@@ -86,7 +86,7 @@ void SwURLStateChanged::Notify( SfxBroad
                 const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( false );
 				const SwTxtAttr* pAttr = pTxtAttr;
 				SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
-										  *pAttr->GetEnd(),
+										  *pAttr->End(),
 										  RES_FMT_CHG );
                 ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
 			}

Modified: openoffice/branches/l10n40/main/sw/source/core/docnode/node.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/docnode/node.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/docnode/node.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/docnode/node.cxx Tue Nov 19 22:39:40 2013
@@ -1041,7 +1041,9 @@ SwCntntNode::~SwCntntNode()
 	// der Abhaengikeitsliste raus!
 	// Daher muessen alle Frames in der Abhaengigkeitsliste geloescht werden.
 	if( GetDepends() )
-		DelFrms();
+		//IAccessibility2 Implementation 2009-----
+		DelFrms(sal_True, sal_False);
+		//-----IAccessibility2 Implementation 2009
 
     if( pCondColl )
 		delete pCondColl;
@@ -1368,12 +1370,77 @@ void SwCntntNode::MakeFrms( SwCntntNode&
  */
 
 
-void SwCntntNode::DelFrms()
+//IAccessibility2 Implementation 2009-----
+//Solution:Add a input param to identify if the acc table should be disposed.
+//add a flag(bNeedDel) to indicate whether to del corresponding frm even in doc loading process, 
+//void SwCntntNode::DelFrms()
+void SwCntntNode::DelFrms( sal_Bool bNeedDel, sal_Bool bIsDisposeAccTable )
+//-----IAccessibility2 Implementation 2009
 {
 	if( !GetDepends() )
 		return;
 
-    SwCntntFrm::DelFrms(*this);
+	SwClientIter aIter( *this );
+	SwCntntFrm *pFrm;
+
+	for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm;
+		 pFrm = (SwCntntFrm*)aIter.Next() )
+	{
+        // --> OD 2005-12-01 #i27138#
+        // notify accessibility paragraphs objects about changed
+        // CONTENT_FLOWS_FROM/_TO relation.
+        // Relation CONTENT_FLOWS_FROM for current next paragraph will change
+        // and relation CONTENT_FLOWS_TO for current previous paragraph will change.
+        if ( pFrm->IsTxtFrm() )
+        {
+            ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
+            if ( pViewShell && pViewShell->GetLayout() &&
+                 pViewShell->GetLayout()->IsAnyShellAccessible() )
+            {
+                pViewShell->InvalidateAccessibleParaFlowRelation(
+                            dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
+                            dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
+            }
+        }
+        // <--
+        if( pFrm->HasFollow() )
+            pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
+        if( pFrm->IsFollow() )
+        {
+            SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
+            pMaster->SetFollow( pFrm->GetFollow() );
+            pFrm->_SetIsFollow( sal_False );
+        }
+		pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
+								//Andernfalls kann es sein, dass ein Follow
+								//vor seinem Master zerstoert wird, der Master
+								//greift dann ueber den ungueltigen
+								//Follow-Pointer auf fremdes Memory zu.
+								//Die Kette darf hier zerknauscht werden, weil
+								//sowieso alle zerstoert werden.
+		if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() &&
+			!pFrm->GetIndPrev() )
+		{
+			SwFtnFrm *pFtn = pFrm->FindFtnFrm();
+			ASSERT( pFtn, "You promised a FtnFrm?" );
+			SwCntntFrm* pCFrm;
+			if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
+				0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
+			{
+				ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+				((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
+			}
+		}
+		//IAccessibility2 Implementation 2009-----
+		//Solution:Set acc table dispose state
+		pFrm->SetAccTableDispose( bIsDisposeAccTable );
+		//End Added
+		pFrm->Cut();
+		//Solution:Set acc table dispose state to default value
+		pFrm->SetAccTableDispose( sal_True );
+		//-----IAccessibility2 Implementation 2009
+		delete pFrm;
+	}
 	if( IsTxtNode() )
 	{
         ((SwTxtNode*)this)->SetWrong( NULL );

Modified: openoffice/branches/l10n40/main/sw/source/core/docnode/nodes.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/docnode/nodes.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/docnode/nodes.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/docnode/nodes.cxx Tue Nov 19 22:39:40 2013
@@ -180,12 +180,9 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
             if ( rNd.IsTxtNode() )
             {
                 SwTxtNode* pTxtNode = rNd.GetTxtNode();
-                // --> OD 2008-03-13 #refactorlists#
-//                pTxtNode->UnregisterNumber();
                 pTxtNode->RemoveFromList();
-                // <--
 
-				//if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )//#outline level,zhaojianwei
+                //if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )//#outline level,zhaojianwei
                 if ( pTxtNode->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
                 {
                     const SwNodePtr pSrch = (SwNodePtr)&rNd;
@@ -194,24 +191,21 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
             }
             // <--
 
-			BigPtrArray::Move( aDelIdx.GetIndex(), rInsPos.GetIndex() );
+            BigPtrArray::Move( aDelIdx.GetIndex(), rInsPos.GetIndex() );
 
-			if( rNd.IsTxtNode() )
-			{
-				SwTxtNode& rTxtNd = (SwTxtNode&)rNd;
-                // --> OD 2008-03-13 #refactorlists#
-//                rTxtNd.SyncNumberAndNumRule();
+            if( rNd.IsTxtNode() )
+            {
+                SwTxtNode& rTxtNd = (SwTxtNode&)rNd;
                 rTxtNd.AddToList();
-                // <--
 
                 if( bInsOutlineIdx &&
-					//NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+                    //NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
                     0 != rTxtNd.GetAttrOutlineLevel() )//<-end,zhaojianwei
-				{
-					const SwNodePtr pSrch = (SwNodePtr)&rNd;
-					pOutlineNds->Insert( pSrch );
-				}
-				rTxtNd.InvalidateNumRule();
+                {
+                    const SwNodePtr pSrch = (SwNodePtr)&rNd;
+                    pOutlineNds->Insert( pSrch );
+                }
+                rTxtNd.InvalidateNumRule();
 
 //FEATURE::CONDCOLL
 				if( RES_CONDTXTFMTCOLL == rTxtNd.GetTxtColl()->Which() )
@@ -273,11 +267,8 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
 					// Numerierungen auch aktualisiert werden.
 					pTxtNd->InvalidateNumRule();
 
-                // --> OD 2008-03-13 #refactorlists#
-//                pTxtNd->UnregisterNumber();
                 pTxtNd->RemoveFromList();
-                // <--
-			}
+            }
 
 			RemoveNode( rDelPos.GetIndex(), 1, sal_False );		// Indizies verschieben !!
 			SwCntntNode * pCNd = pNd->GetCntntNode();
@@ -298,10 +289,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
 						rNds.pOutlineNds->Insert( pTxtNd );
                     }
 
-                    // --> OD 2008-03-13 #refactorlists#
-//                    pTxtNd->SyncNumberAndNumRule();
                     pTxtNd->AddToList();
-                    // <--
 
 					// Sonderbehandlung fuer die Felder!
 					if( pHts && pHts->Count() )
@@ -316,9 +304,9 @@ void SwNodes::ChgNode( SwNodeIndex& rDel
                             switch ( pAttr->Which() )
                             {
                             case RES_TXTATR_FIELD:
+                            case RES_TXTATR_INPUTFIELD:
                                 {
-                                    SwTxtFld* pTxtFld =
-                                        static_cast<SwTxtFld*>(pAttr);
+                                    SwTxtFld* pTxtFld = static_cast<SwTxtFld*>(pAttr);
                                     rNds.GetDoc()->InsDelFldInFldLst( !bToUndo, *pTxtFld );
 
                                     const SwFieldType* pTyp = pTxtFld->GetFmtFld().GetField()->GetTyp();
@@ -909,6 +897,17 @@ sal_Bool SwNodes::_MoveNodes( const SwNo
 			break;
 
 		case ND_TEXTNODE:
+			//IAccessibility2 Implementation 2009-----
+			//Solution:Add special function to text node.
+			{
+				if( bNewFrms && pAktNode->GetCntntNode() )
+					((SwCntntNode*)pAktNode)->DelFrms( sal_False );
+				pAktNode->pStartOfSection = aSttNdStack[ nLevel ];
+				nInsPos++;
+				aRg.aEnd--;
+			}
+			break;
+		    //-----IAccessibility2 Implementation 2009
 		case ND_GRFNODE:
 		case ND_OLENODE:
 			{

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/acorrect.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/acorrect.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/acorrect.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/acorrect.cxx Tue Nov 19 22:39:40 2013
@@ -518,7 +518,7 @@ void SwDontExpandItem::RestoreDontExpand
 				if( nAttrStart > nStart ) 		// ueber den Bereich hinaus
 					break;
 
-				if( 0 != ( pAttrEnd = pHt->GetEnd() ) &&
+				if( 0 != ( pAttrEnd = pHt->End() ) &&
 					( ( nAttrStart < nStart &&
 						( pHt->DontExpand() ? nStart < *pAttrEnd
 											: nStart <= *pAttrEnd )) ||

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/edatmisc.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/edatmisc.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/edatmisc.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/edatmisc.cxx Tue Nov 19 22:39:40 2013
@@ -127,7 +127,7 @@ const SfxPoolItem& SwEditShell::GetDefau
 }
 
 
-void SwEditShell::SetAttr( const SfxPoolItem& rHint, sal_uInt16 nFlags )
+void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, sal_uInt16 nFlags )
 {
 	SET_CURR_SHELL( this );
 	StartAllAction();
@@ -157,7 +157,7 @@ void SwEditShell::SetAttr( const SfxPool
 }
 
 
-void SwEditShell::SetAttr( const SfxItemSet& rSet, sal_uInt16 nFlags )
+void SwEditShell::SetAttrSet( const SfxItemSet& rSet, sal_uInt16 nFlags )
 {
 	SET_CURR_SHELL( this );
 	StartAllAction();

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/edattr.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/edattr.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/edattr.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/edattr.cxx Tue Nov 19 22:39:40 2013
@@ -238,18 +238,17 @@ sal_Bool SwEditShell::GetCurFtn( SwFmtFt
 bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn )
 {
     bool bChgd = false;
-	StartAllAction();
+    StartAllAction();
 
-	SwPaM* pCrsr = GetCrsr(), *pFirst = pCrsr;
-	do {
-		bChgd |=  pDoc->SetCurFtn( *pCrsr, rFillFtn.GetNumStr(),
-											rFillFtn.GetNumber(),
-											rFillFtn.IsEndNote() );
+    SwPaM* pCrsr = GetCrsr(), *pFirst = pCrsr;
+    do {
+        bChgd |=
+            pDoc->SetCurFtn( *pCrsr, rFillFtn.GetNumStr(), rFillFtn.GetNumber(), rFillFtn.IsEndNote() );
 
-	} while( pFirst != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
+    } while( pFirst != ( pCrsr = (SwPaM*)pCrsr->GetNext() ));
 
-	EndAllAction();
-	return bChgd;
+    EndAllAction();
+    return bChgd;
 }
 
 
@@ -423,33 +422,32 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const 
     {
         bRet = sal_False;
 
-        // --> OD 2008-03-19 #refactorlists#
         if ( rTNd.IsInList() )
         {
             ASSERT( rTNd.GetNumRule(),
                     "<lcl_IsNoEndTxtAttrAtPos(..)> - no list style found at text node. Serious defect -> please inform OD." );
             const SwNumRule* pNumRule = rTNd.GetNumRule();
-			//Modified for i119959,2012.6.12
-			//Under this scenario,this pointer is null,but on win,it doesn't crash immediately
-			//it exits with exception,and associated memory will have problem which leads to crash problem in 
-			//other place in dev env...
-			if ( pNumRule )
-			{
-			//End
-            const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) );
-            if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
+            //Modified for i119959,2012.6.12
+            //Under this scenario,this pointer is null,but on win,it doesn't crash immediately
+            //it exits with exception,and associated memory will have problem which leads to crash problem in 
+            //other place in dev env...
+            if ( pNumRule )
             {
-                if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
-                    sExp = rNumFmt.GetBulletChar();
-                else
-                    sExp = rTNd.GetNumString();
-				}
-			//Modified for i119959,2012.6.12
-			//Under this scenario,this pointer is null,but on win,it doesn't crash immediately
-			//it exits with exception,and associated memory will have problem which leads to crash problem in 
-			//other place in dev env...
-			}
-			//End
+                //End
+                const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) );
+                if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() )
+                {
+                    if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
+                        sExp = rNumFmt.GetBulletChar();
+                    else
+                        sExp = rTNd.GetNumString();
+                }
+                //Modified for i119959,2012.6.12
+                //Under this scenario,this pointer is null,but on win,it doesn't crash immediately
+                //it exits with exception,and associated memory will have problem which leads to crash problem in 
+                //other place in dev env...
+            }
+            //End
         }
     }
 
@@ -491,7 +489,7 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const 
                                         getScriptType( sExp, nEnd-1 ));
     }
 
-	return bRet;
+    return bRet;
 }
 
 

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/edfld.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/edfld.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/edfld.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/edfld.cxx Tue Nov 19 22:39:40 2013
@@ -28,7 +28,6 @@
 #include <unotools/charclass.hxx>
 #include <editsh.hxx>
 #include <fldbas.hxx>
-#include <ndtxt.hxx>		// GetCurFld
 #include <doc.hxx>
 #include <docary.hxx>
 #include <fmtfld.hxx>
@@ -220,73 +219,23 @@ void SwEditShell::FieldToText( SwFieldTy
 *************************************************************************/
 void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints)
 {
-	SET_CURR_SHELL( this );
-	StartAllAction();
-	SwFmtFld aFld( rFld );
+    SET_CURR_SHELL( this );
+    StartAllAction();
+    SwFmtFld aFld( rFld );
 
     const SetAttrMode nInsertFlags = (bForceExpandHints)
         ? nsSetAttrMode::SETATTR_FORCEHINTEXPAND
         : nsSetAttrMode::SETATTR_DEFAULT;
 
-	FOREACHPAM_START(this)						// fuer jeden PaM
-        bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
+    FOREACHPAM_START(this)
+        const bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
         ASSERT( bSuccess, "Doc->Insert(Field) failed");
         (void) bSuccess;
-	FOREACHPAM_END()					  // fuer jeden PaM
+    FOREACHPAM_END()
 
-	EndAllAction();
+    EndAllAction();
 }
 
-/*************************************************************************
-|*
-|*					SwEditShell::GetCurFld()
-|*
-|*	  Beschreibung	Stehen die PaMs auf Feldern ?
-|*	  Quelle:		edtfrm.cxx:
-|*
-*************************************************************************/
-
-inline SwTxtFld *GetDocTxtFld( const SwPosition* pPos )
-{
-    SwTxtNode * const pNode = pPos->nNode.GetNode().GetTxtNode();
-    return (pNode)
-        ? static_cast<SwTxtFld*>( pNode->GetTxtAttrForCharAt(
-                pPos->nContent.GetIndex(), RES_TXTATR_FIELD ))
-        : 0;
-}
-
-SwField* SwEditShell::GetCurFld() const
-{
-	// Wenn es keine Selektionen gibt, gilt der Wert der aktuellen
-	// Cursor-Position.
-
-	SwPaM* pCrsr = GetCrsr();
-	SwTxtFld *pTxtFld = GetDocTxtFld( pCrsr->Start() );
-	SwField *pCurFld = NULL;
-
-    /* #108536# Field was only recognized if no selection was
-        present. Now it is recognized if either the cursor is in the
-        field or the selection spans exactly over the field. */
-	if( pTxtFld &&
-        pCrsr->GetNext() == pCrsr &&
-        pCrsr->Start()->nNode == pCrsr->End()->nNode &&
-        (pCrsr->End()->nContent.GetIndex() -
-         pCrsr->Start()->nContent.GetIndex()) <= 1)
-	{
-		pCurFld = (SwField*)pTxtFld->GetFmtFld().GetField();
-		// TabellenFormel ? wandel internen in externen Namen um
-		if( RES_TABLEFLD == pCurFld->GetTyp()->Which() )
-		{
-			const SwTableNode* pTblNd = IsCrsrInTbl();
-			((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
-		}
-
-	}
-
-    /* #108536# removed handling of multi-selections */
-
-	return pCurFld;
-}
 
 
 /*************************************************************************
@@ -299,25 +248,35 @@ SwField* SwEditShell::GetCurFld() const
 *************************************************************************/
 SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld )
 {
-	// suche das Feld ueber seine Addresse. Muss fuer InputFelder in
-	// geschuetzten Feldern erfolgen
-	SwTxtFld* pTFld = 0;
-	if( RES_INPUTFLD == rFld.Which() || ( RES_SETEXPFLD == rFld.Which() &&
-		((SwSetExpField&)rFld).GetInputFlag() ) )
-	{
-		const SfxPoolItem* pItem;
-		sal_uInt32 n, nMaxItems =
+    SwTxtFld* pTFld = 0;
+    if( RES_INPUTFLD == rFld.Which() )
+    {
+        const SfxPoolItem* pItem = NULL;
+        const sal_uInt32 nMaxItems =
+            pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INPUTFIELD );
+        for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+            if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_INPUTFIELD, n ) )
+                && ((SwFmtFld*)pItem)->GetField() == &rFld )
+            {
+                pTFld = ((SwFmtFld*)pItem)->GetTxtFld();
+                break;
+            }
+    }
+    else if( RES_SETEXPFLD == rFld.Which()
+        && ((SwSetExpField&)rFld).GetInputFlag() )
+    {
+        const SfxPoolItem* pItem = NULL;
+        const sal_uInt32 nMaxItems =
             pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD );
-		for( n = 0; n < nMaxItems; ++n )
-			if( 0 != (pItem =
-                      pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )
-				&& ((SwFmtFld*)pItem)->GetField() == &rFld )
-			{
-				pTFld = ((SwFmtFld*)pItem)->GetTxtFld();
-				break;
-			}
-	}
-	return pTFld;
+        for( sal_uInt32 n = 0; n < nMaxItems; ++n )
+            if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) )
+                && ((SwFmtFld*)pItem)->GetField() == &rFld )
+            {
+                pTFld = ((SwFmtFld*)pItem)->GetTxtFld();
+                break;
+            }
+    }
+    return pTFld;
 }
 
 void SwEditShell::UpdateFlds( SwField &rFld )
@@ -339,14 +298,9 @@ void SwEditShell::UpdateFlds( SwField &r
 		SwTxtFld *pTxtFld;
 		SwFmtFld *pFmtFld;
 
-// 		if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() &&
-// 			( 0 != ( pTxtFld = GetDocTxtFld( pCrsr->Start() ) ) ||
-// 			  0 != ( pTxtFld = lcl_FindInputFld( GetDoc(), rFld ) ) ) &&
-// 			( pFmtFld = (SwFmtFld*)&pTxtFld->GetFld())->GetFld()
-// 				->GetTyp()->Which() == rFld.GetTyp()->Which() )
         if ( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark())
         {
-            pTxtFld = GetDocTxtFld(pCrsr->Start());
+            pTxtFld = GetTxtFldAtPos( pCrsr->Start(), true );
 
             if (!pTxtFld) // #i30221#
                 pTxtFld = lcl_FindInputFld( GetDoc(), rFld);
@@ -361,7 +315,8 @@ void SwEditShell::UpdateFlds( SwField &r
 		sal_Bool bOkay = sal_True;
 		sal_Bool bTblSelBreak = sal_False;
 
-		SwMsgPoolItem aHint( RES_TXTATR_FIELD );  // Such-Hint
+		SwMsgPoolItem aFldHint( RES_TXTATR_FIELD );
+		SwMsgPoolItem aInputFldHint( RES_TXTATR_INPUTFIELD );
 		FOREACHPAM_START(this)						// fuer jeden PaM
 			if( PCURCRSR->HasMark() && bOkay )		// ... mit Selektion
 			{
@@ -382,13 +337,14 @@ void SwEditShell::UpdateFlds( SwField &r
 				// Suche nach SwTxtFld ...
 				while(	bOkay
 					 && pCurStt->nContent != pCurEnd->nContent
-					 && aPam.Find( aHint, sal_False, fnMoveForward, &aCurPam ) )
+					 && ( aPam.Find( aFldHint, sal_False, fnMoveForward, &aCurPam )
+                          || aPam.Find( aInputFldHint, sal_False, fnMoveForward, &aCurPam ) ) )
 				{
 					//	wenn nur ein Pam mehr als ein Feld enthaelt ...
 					if( aPam.Start()->nContent != pCurStt->nContent )
 						bOkay = sal_False;
 
-					if( 0 != (pTxtFld = GetDocTxtFld( pCurStt )) )
+					if( 0 != (pTxtFld = GetTxtFldAtPos( pCurStt, true )) )
 					{
 						pFmtFld = (SwFmtFld*)&pTxtFld->GetFmtFld();
 						pCurFld = pFmtFld->GetField();

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/edfldexp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/edfldexp.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/edfldexp.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/edfldexp.cxx Tue Nov 19 22:39:40 2013
@@ -31,7 +31,6 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <doc.hxx>
 #include <docary.hxx>
-#include <ndtxt.hxx>		// GetCurFld
 #include <txtfld.hxx>
 #include <fmtfld.hxx>
 #include <edimp.hxx>

Modified: openoffice/branches/l10n40/main/sw/source/core/edit/editsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/sw/source/core/edit/editsh.cxx?rev=1543609&r1=1543608&r2=1543609&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/sw/source/core/edit/editsh.cxx (original)
+++ openoffice/branches/l10n40/main/sw/source/core/edit/editsh.cxx Tue Nov 19 22:39:40 2013
@@ -785,7 +785,7 @@ sal_Bool SwEditShell::InsertURL( const S
 	else
 		bInsTxt = sal_False;
 
-	SetAttr( rFmt );
+	SetAttrItem( rFmt );
 	if (bInsTxt && !IsCrsrPtAtEnd())
 		SwapPam();
 	if(!bKeepSelection)
@@ -815,7 +815,7 @@ sal_uInt16 SwEditShell::GetINetAttrs( Sw
 			{
 				SwTxtINetFmt& rAttr = *pFnd;
 				String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
-									*rAttr.GetEnd() - *rAttr.GetStart() ) );
+									*rAttr.End() - *rAttr.GetStart() ) );
 
 				sTxt.EraseAllChars( 0x0a );
 				sTxt.EraseLeadingChars().EraseTrailingChars();