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

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Thu Dec 8 04:43:15 PST 2011


 sw/source/core/fields/reffld.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit da8d70bcac0276a4ac9dcdd65e90e16211f45dc3
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu Dec 8 12:34:39 2011 +0100

    fdo#43521: Don't shown the name of a reference field if it's empty

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index ff29f49..98111d0 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -276,10 +276,15 @@ String SwGetRefField::Expand() const
 
 String SwGetRefField::GetFieldName() const
 {
-    String aStr(GetTyp()->GetName());
-    aStr += ' ';
-    aStr += sSetRefName;
-    return aStr;
+    if ( GetTyp()->GetName().Len() > 0 || sSetRefName.Len() > 0 )
+    {
+        String aStr(GetTyp()->GetName());
+        aStr += ' ';
+        aStr += sSetRefName;
+        return aStr;
+    }
+    else
+        return Expand();
 }
 
 // #i81002# - parameter <pFldTxtAttr> added


More information about the Libreoffice-commits mailing list