On Sat, Jan 7, 2012 at 7:39 PM, Ivan Timofeev <[email protected]>wrote:

> 06.01.2012 20:57, Lior Kaplan пишет:

    The strings are coming from svx/source/items/svxitems.src
>>    (RID_SVXITEMS_PAGE_LAND_FALSE and RID_SVXITEMS_PAGE_USAGE_LEFT), and
>>    the only reference for them I found is svx/source/items/pageitem.cxx
>>
>>    I compared it to the code of other items in the page, and didn't
>>    find any space addition the other strings... any idea why in this
>>    case there's a missing space?
>>
>
> Bug? The author forgot to add the delimiter?
>
>            if ( bLandscape )
>                rText += SVX_RESSTR(RID_SVXITEMS_PAGE_**LAND_TRUE);
>            else
>                rText += SVX_RESSTR(RID_SVXITEMS_PAGE_**LAND_FALSE);
> -           rText += GetUsageText( eUse );
> +           String aUsageText = GetUsageText( eUse );
> +           if (aUsageText.Len())
> +           {
> +               rText += cpDelim;
> +               rText += aUsageText;
> +           }
>            return SFX_ITEM_PRESENTATION_**NAMELESS;
>
>        }
>

Cool (:

This fix is also relevant a few lines bellow, adding a patch to include
them both.

Also, including [REVIEW] in the subject.

Kaplan
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 0ac676d..e544382 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -136,7 +136,12 @@ SfxItemPresentation SvxPageItem::GetPresentation
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_TRUE);
             else
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_FALSE);
-            rText += GetUsageText( eUse );
+            String aUsageText = GetUsageText( eUse );
+            if (aUsageText.Len())
+            {
+                rText += cpDelim;
+                rText += aUsageText;
+            }
             return SFX_ITEM_PRESENTATION_NAMELESS;
         }
         case SFX_ITEM_PRESENTATION_COMPLETE:
@@ -154,7 +159,12 @@ SfxItemPresentation SvxPageItem::GetPresentation
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_TRUE);
             else
                 rText += SVX_RESSTR(RID_SVXITEMS_PAGE_LAND_FALSE);
-            rText += GetUsageText( eUse );
+            String aUsageText = GetUsageText( eUse );
+            if (aUsageText.Len())
+            {
+                rText += cpDelim;
+                rText += aUsageText;
+            }
             return SFX_ITEM_PRESENTATION_COMPLETE;
         }
         default: ;//prevent warning
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to