[ooo-build-commit] .: 2 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Sep 14 07:02:44 PDT 2010


 sw/source/core/crsr/pam.cxx        |   28 +++++++++++++++++-----------
 sw/source/core/unocore/unocoll.cxx |   18 +++++++++---------
 2 files changed, 26 insertions(+), 20 deletions(-)

New commits:
commit 8208802eed76b29302c132dd0a0608cc71dd396f
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Sep 14 16:00:07 2010 +0200

    field-patch-lock.diff: enhanced fields lock fix

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index a31ae4c..6de3089 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -825,21 +825,27 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
     }
     //FIXME FieldBk
     // TODO: Form Protection when Enhanced Fields are enabled
-    if (!bRet) {
-        const SwDoc *pDoc = GetDoc();
-        sw::mark::IMark* pA = NULL;
-        sw::mark::IMark* pB = NULL;
-        if ( pDoc )
-        {
-            const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
-            pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
-            pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
-            bRet = ( pA != pB );
-        }
+    const SwDoc *pDoc = GetDoc();
+    sw::mark::IMark* pA = NULL;
+    sw::mark::IMark* pB = NULL;
+    if ( pDoc )
+    {
+        const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
+        pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
+        pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
+    }
+
+    if (!bRet)
+    {
+        bRet = ( pA != pB );
         bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
         if ( bProtectForm )
             bRet |= ( pA == NULL || pB == NULL );
     }
+    else
+    {
+        bRet = !( pA == pB && pA != NULL );
+    }
     return bRet;
 }
 
commit 7bd9bc8377047629a69450bf7d4c7dee67af517b
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Sep 14 15:58:16 2010 +0200

    field-patch-uno-fix.diff: enhanced fields UNO fix

diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 03df3e1..85c6b3f 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1504,7 +1504,7 @@ sal_Int32 SwXBookmarks::getCount(void)
     vos::OGuard aGuard(Application::GetSolarMutex());
     if(!IsValid())
         throw uno::RuntimeException();
-    return GetDoc()->getIDocumentMarkAccess()->getBookmarksCount();
+    return GetDoc()->getIDocumentMarkAccess()->getMarksCount();
 }
 
 uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex)
@@ -1514,11 +1514,11 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex)
     if(!IsValid())
         throw uno::RuntimeException();
     IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
-    if(nIndex < 0 || nIndex >= pMarkAccess->getBookmarksCount())
+    if(nIndex < 0 || nIndex >= pMarkAccess->getMarksCount())
         throw IndexOutOfBoundsException();
 
     uno::Any aRet;
-    ::sw::mark::IMark* pBkmk = pMarkAccess->getBookmarksBegin()[nIndex].get();
+    ::sw::mark::IMark* pBkmk = pMarkAccess->getMarksBegin()[nIndex].get();
     const uno::Reference< text::XTextContent > xRef =
         SwXBookmark::CreateXBookmark(*GetDoc(), *pBkmk);
     aRet <<= xRef;
@@ -1533,8 +1533,8 @@ uno::Any SwXBookmarks::getByName(const rtl::OUString& rName)
         throw uno::RuntimeException();
 
     IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
-    IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark(rName);
-    if(ppBkmk == pMarkAccess->getBookmarksEnd())
+    IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark(rName);
+    if(ppBkmk == pMarkAccess->getMarksEnd())
         throw NoSuchElementException();
 
     uno::Any aRet;
@@ -1552,10 +1552,10 @@ uno::Sequence< OUString > SwXBookmarks::getElementNames(void)
         throw uno::RuntimeException();
 
     IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
-    uno::Sequence<OUString> aSeq(pMarkAccess->getBookmarksCount());
+    uno::Sequence<OUString> aSeq(pMarkAccess->getMarksCount());
     sal_Int32 nCnt = 0;
-    for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
-        ppMark != pMarkAccess->getBookmarksEnd();)
+    for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
+        ppMark != pMarkAccess->getMarksEnd();)
         aSeq[nCnt++] = (*ppMark++)->GetName();
     return aSeq;
 }
@@ -1568,7 +1568,7 @@ sal_Bool SwXBookmarks::hasByName(const OUString& rName)
         throw uno::RuntimeException();
 
     IDocumentMarkAccess* const pMarkAccess = GetDoc()->getIDocumentMarkAccess();
-    return pMarkAccess->findBookmark(rName) != pMarkAccess->getBookmarksEnd();
+    return pMarkAccess->findMark(rName) != pMarkAccess->getMarksEnd();
 }
 
 uno::Type SAL_CALL SwXBookmarks::getElementType()


More information about the ooo-build-commit mailing list