[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Mon Dec 19 08:12:23 PST 2011


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

New commits:
commit a327cd771e18b8677567f576e3bd88b69d2ee200
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