summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2019-07-20 13:17:06 -0800
committerJim Raykowski <raykowj@gmail.com>2019-07-27 05:11:37 +0200
commit5f5bfddf5fe8bbcd77dbb040d0bf77d595c90f30 (patch)
tree92c651c26c53b7cfa515ddb24a13c38e47e1d771 /editeng
parent08995b6a764c9e387c94f6ce5faba2145b5512f9 (diff)
tdf#94395 Show paragraph style line spacing in organizer contains
This patch provides functionality to SvxLineSpacingItem::GetPresentation and also fixes tdf#126466 Change-Id: I9e0cb042c83c568051061de3467d402ef88cfdf4 Reviewed-on: https://gerrit.libreoffice.org/76069 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/paraitem.cxx89
1 files changed, 77 insertions, 12 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 4cf9750f15ca..283ae8fab51b 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -48,6 +48,7 @@
#include <sal/log.hxx>
#include <editeng/memberids.h>
#include <editeng/editids.hrc>
+#include <editeng/editrids.hrc>
#include <editeng/itemtype.hxx>
#include <editeng/eerdll.hxx>
#include <editeng/paperinf.hxx>
@@ -226,23 +227,87 @@ SfxPoolItem* SvxLineSpacingItem::Clone( SfxItemPool * ) const
return new SvxLineSpacingItem( *this );
}
-
bool SvxLineSpacingItem::GetPresentation
(
- SfxItemPresentation /*ePres*/,
- MapUnit /*eCoreUnit*/,
- MapUnit /*ePresUnit*/,
- OUString& rText, const IntlWrapper&
+ SfxItemPresentation ePres,
+ MapUnit eCoreUnit,
+ MapUnit ePresUnit,
+ OUString& rText, const IntlWrapper& rIntl
) const
{
-#ifdef DBG_UTIL
- rText = "SvxLineSpacingItem";
-#else
- rText.clear();
-#endif
- return false;
-}
+ switch ( ePres )
+ {
+ case SfxItemPresentation::Nameless:
+ case SfxItemPresentation::Complete:
+ {
+ switch( GetLineSpaceRule() )
+ {
+ case SvxLineSpaceRule::Auto:
+ {
+ SvxInterLineSpaceRule eInter = GetInterLineSpaceRule();
+ switch( eInter )
+ {
+ // Default single line spacing
+ case SvxInterLineSpaceRule::Off:
+ rText = EditResId(RID_SVXITEMS_LINESPACING_SINGLE);
+ break;
+
+ // Default single line spacing
+ case SvxInterLineSpaceRule::Prop:
+ if ( 100 == GetPropLineSpace() )
+ {
+ rText = EditResId(RID_SVXITEMS_LINESPACING_SINGLE);
+ break;
+ }
+ // 1.15 line spacing
+ if ( 115 == GetPropLineSpace() )
+ {
+ rText = EditResId(RID_SVXITEMS_LINESPACING_115);
+ break;
+ }
+ // 1.5 line spacing
+ if ( 150 == GetPropLineSpace() )
+ {
+ rText = EditResId(RID_SVXITEMS_LINESPACING_15);
+ break;
+ }
+ // double line spacing
+ if ( 200 == GetPropLineSpace() )
+ {
+ rText = EditResId(RID_SVXITEMS_LINESPACING_DOUBLE);
+ break;
+ }
+ // the set per cent value
+ rText = EditResId(RID_SVXITEMS_LINESPACING_PROPORTIONAL) + " " + OUString::number(GetPropLineSpace()) + "%";
+ break;
+
+ case SvxInterLineSpaceRule::Fix:
+ rText = EditResId(RID_SVXITEMS_LINESPACING_LEADING) +
+ " " + GetMetricText(GetInterLineSpace(), eCoreUnit, ePresUnit, &rIntl) +
+ " " + EditResId(GetMetricId(ePresUnit));
+ break;
+ default: ;//prevent warning
+ }
+ }
+ break;
+ case SvxLineSpaceRule::Fix:
+ rText = EditResId(RID_SVXITEMS_LINESPACING_FIXED) +
+ " " + GetMetricText(GetLineHeight(), eCoreUnit, ePresUnit, &rIntl) +
+ " " + EditResId(GetMetricId(ePresUnit));
+ break;
+
+ case SvxLineSpaceRule::Min:
+ rText = EditResId(RID_SVXITEMS_LINESPACING_MIN) +
+ " " + GetMetricText(GetLineHeight(), eCoreUnit, ePresUnit, &rIntl) +
+ " " + EditResId(GetMetricId(ePresUnit));
+ break;
+ default: ;//prevent warning
+ }
+ }
+ }
+ return true;
+}
sal_uInt16 SvxLineSpacingItem::GetValueCount() const
{