[Libreoffice-commits] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Mon Dec 19 07:21:20 PST 2011


 sw/source/core/unocore/unotext.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ab218a565ee9cc033d97d71ab52e9d87b02b1874
Author: Noel Power <noel.power at novell.com>
Date:   Mon Dec 19 16:11:04 2011 +0100

    sw: avoid creating cursor with non-text node text range (fdo#40195)

diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 28ff73f..820239f 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2480,6 +2480,9 @@ throw (uno::RuntimeException)
     SwUnoInternalPaM aPam(*GetDoc());
     if (::sw::XTextRangeToSwPaM(aPam, xTextPosition))
     {
+        if ( !aPam.GetNode()->GetTxtNode() )
+            throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid text range") ), uno::Reference< uno::XInterface >() );
+
         SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent();
 
         SwStartNode* p1 = aPam.GetNode()->StartOfSectionNode();


More information about the Libreoffice-commits mailing list