[Libreoffice-commits] core.git: sw/source

Fridrich Å trba fridrich.strba at bluewin.ch
Thu May 2 02:53:10 PDT 2013


 sw/source/core/text/inftxt.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c18d8bd2d2ec5ba8dd9c43a99117aed82a919267
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu May 2 11:51:53 2013 +0200

    Don't crash with empty *pTxt
    
    Change-Id: I5fdd0cbc70dec1119b1b6a76cb3c5805f11c11ed

diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 2faee80..0fd3922 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -265,7 +265,7 @@ public:
     inline const  SwViewOption &GetOpt() const { return *pOpt; }
     inline const OUString &GetTxt() const { return *pTxt; }
     inline sal_Unicode GetChar( const sal_Int32 nPos ) const
-    { return (*pTxt)[ nPos ]; }
+    { if (pTxt && !pTxt->isEmpty()) return (*pTxt)[ nPos ]; return 0; }
 
     inline KSHORT      GetTxtHeight() const;
 


More information about the Libreoffice-commits mailing list