[ooo-build-commit] 2 commits - patches/dev300

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Sep 30 02:31:40 PDT 2009


 patches/dev300/apply                    |    1 
 patches/dev300/field-patch-uno-fix.diff |   90 ++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)

New commits:
commit f5c008662a90c0d542cd703377dd15a84797f7c5
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Sep 30 11:32:19 2009 +0200

    fixed UNO fields patch and applied it
    
    * patches/dev300/apply: added the field-patch-uno-fix.diff
    * patches/dev300/field-patch-uno-fix.diff: removed a/ and b/

diff --git a/patches/dev300/apply b/patches/dev300/apply
index da8d624..112fe8e 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2850,6 +2850,7 @@ sw-allow-negative-spacing.diff, n#364534, freuter
 # oox-fix-abs-relations.diff, n#493528, freuter
 
 field-patch.diff, n#248354, freuter
+field-patch-uno-fix.diff, cbosdo
 
 sw-import-html-controls.diff, n#485609, freuter
 svx-hacky-htmlselect-control-import.diff, n#523191, noelpwer
diff --git a/patches/dev300/field-patch-uno-fix.diff b/patches/dev300/field-patch-uno-fix.diff
index a541ab5..efe06a1 100644
--- a/patches/dev300/field-patch-uno-fix.diff
+++ b/patches/dev300/field-patch-uno-fix.diff
@@ -1,7 +1,7 @@
-diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
+diff --git sw/source/core/unocore/unocoll.cxx sw/source/core/unocore/unocoll.cxx
 index abb24b5..f890609 100644
---- a/sw/source/core/unocore/unocoll.cxx
-+++ b/sw/source/core/unocore/unocoll.cxx
+--- sw/source/core/unocore/unocoll.cxx
++++ sw/source/core/unocore/unocoll.cxx
 @@ -1697,7 +1697,7 @@ sal_Int32 SwXBookmarks::getCount(void)
      vos::OGuard aGuard(Application::GetSolarMutex());
      if(!IsValid())
commit 26aadbaae8215098ccaa2d8f0bef1cad73d2ea9b
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Sep 30 10:59:54 2009 +0200

    Fixed some bugs in the UNO API related to fields
    
    * patches/dev300/field-patch-uno-fix.diff:
        small temporary fix: will have to be checked with upstream

diff --git a/patches/dev300/field-patch-uno-fix.diff b/patches/dev300/field-patch-uno-fix.diff
new file mode 100644
index 0000000..a541ab5
--- /dev/null
+++ b/patches/dev300/field-patch-uno-fix.diff
@@ -0,0 +1,90 @@
+diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
+index abb24b5..f890609 100644
+--- a/sw/source/core/unocore/unocoll.cxx
++++ b/sw/source/core/unocore/unocoll.cxx
+@@ -1697,7 +1697,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)
+@@ -1707,11 +1707,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();
+     uno::Reference< XTextContent > xRef = GetObject(*pBkmk, GetDoc());
+     aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0));
+     return aRet;
+@@ -1725,8 +1725,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;
+@@ -1743,10 +1743,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;
+ }
+@@ -1759,7 +1759,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()
+@@ -1784,16 +1784,18 @@ SwXBookmark* SwXBookmarks::GetObject( ::sw::mark::IMark& rBkmk, SwDoc* pDoc)
+     if(!pXBkmk)
+     {
+         // FIXME: These belong in XTextFieldsSupplier
+-        //if (dynamic_cast< ::sw::mark::TextFieldmark* >(&rBkmk))
+-        //    pXBkmk = new SwXFieldmark(false, &rBkmk, pDoc);
+-        //else if (dynamic_cast< ::sw::mark::CheckboxFieldmark* >(&rBkmk))
+-        //    pXBkmk = new SwXFieldmark(true, &rBkmk, pDoc);
+-        //else
+-        OSL_ENSURE(
+-            dynamic_cast< ::sw::mark::IBookmark* >(&rBkmk),
+-            "<SwXBookmark::GetObject(..)>"
+-            "SwXBookmark requested for non-bookmark mark.");
+-        pXBkmk = new SwXBookmark(&rBkmk, pDoc);
++        if (dynamic_cast< ::sw::mark::ICheckboxFieldmark* >(&rBkmk))
++            pXBkmk = new SwXFieldmark(true, &rBkmk, pDoc);
++        else if (dynamic_cast< ::sw::mark::IFieldmark* >(&rBkmk))
++            pXBkmk = new SwXFieldmark(false, &rBkmk, pDoc);
++        else
++        {
++            OSL_ENSURE(
++                dynamic_cast< ::sw::mark::IBookmark* >(&rBkmk),
++                "<SwXBookmark::GetObject(..)>"
++                "SwXBookmark requested for non-bookmark mark.");
++            pXBkmk = new SwXBookmark(&rBkmk, pDoc);
++        }
+     }
+     return pXBkmk;
+ }


More information about the ooo-build-commit mailing list