[Libreoffice-commits] .: 2 commits - lotuswordpro/source svtools/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed May 9 08:37:43 PDT 2012
lotuswordpro/source/filter/lwptablelayout.cxx | 2 -
lotuswordpro/source/filter/xfilter/xfutil.cxx | 45 +++++++++++++++++---------
svtools/source/control/ctrltool.cxx | 24 ++++++++++---
3 files changed, 50 insertions(+), 21 deletions(-)
New commits:
commit c7a9318f08e08a35f2784bf8d06f62031649b24e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 9 16:33:58 2012 +0100
sort fonts so that upright faces are shown in the font dropdown list
Change font sort so that font faces like those of URW Palladio L whose italic
variant is lighter than its upright variant are sorted with the upright fonts
first so we don't see italic variants in the font widget.
Also sort "normal" weight faces below all other weights
Change-Id: I9c81b475d95b9dd17a873fd791b942512ff039c7
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 3fdd515..ffa4fbb 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -123,19 +123,33 @@ private:
{}
};
-// =======================================================================
+//sort normal to the start
+static int sortWeightValue(FontWeight eWeight)
+{
+ if (eWeight == WEIGHT_NORMAL)
+ return 0;
+ if (eWeight < WEIGHT_NORMAL)
+ return eWeight + 1;
+ if (eWeight > WEIGHT_NORMAL)
+ return eWeight - 1;
+}
static StringCompare ImplCompareFontInfo( ImplFontListFontInfo* pInfo1,
ImplFontListFontInfo* pInfo2 )
{
- if ( pInfo1->GetWeight() < pInfo2->GetWeight() )
+ //Sort non italic before italics
+ if ( pInfo1->GetItalic() < pInfo2->GetItalic() )
return COMPARE_LESS;
- else if ( pInfo1->GetWeight() > pInfo2->GetWeight() )
+ else if ( pInfo1->GetItalic() > pInfo2->GetItalic() )
return COMPARE_GREATER;
- if ( pInfo1->GetItalic() < pInfo2->GetItalic() )
+ //Sort normal weight to the start, followed by lightest to heaviest weights
+ int nWeight1 = sortWeightValue(pInfo1->GetWeight());
+ int nWeight2 = sortWeightValue(pInfo2->GetWeight());
+
+ if ( nWeight1 < nWeight2 )
return COMPARE_LESS;
- else if ( pInfo1->GetItalic() > pInfo2->GetItalic() )
+ else if ( nWeight1 > nWeight2 )
return COMPARE_GREATER;
return pInfo1->GetStyleName().CompareTo( pInfo2->GetStyleName() );
commit e78b716035c42e4397524c04ff4db83944576bbb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 9 14:43:27 2012 +0100
WaE: silence tedious msvc2008 warnings
Change-Id: Iecdc085b9af162ffdc6e0c52ad8a408a0983e088
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 5f9ae7e..ec05975 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1245,7 +1245,7 @@ void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uIn
return;
}
- for (sal_uInt16 iLoop = 0; iLoop < nEndCol-nStartCol ; iLoop ++)
+ for (sal_uInt32 iLoop = 0; iLoop < static_cast<sal_uInt32>(nEndCol)-nStartCol; ++iLoop)
{
// add row to table
LwpObjectID *pColID = GetColumnLayoutHead();
diff --git a/lotuswordpro/source/filter/xfilter/xfutil.cxx b/lotuswordpro/source/filter/xfilter/xfutil.cxx
index 480482f..9eacb95 100644
--- a/lotuswordpro/source/filter/xfilter/xfutil.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfutil.cxx
@@ -488,44 +488,59 @@ rtl::OUString GetDrawKind(enumXFDrawKind kind)
rtl::OUString GetPageUsageName(enumXFPageUsage usage)
{
+ rtl::OUString sRet;
switch(usage)
{
case enumXFPageUsageAll:
- return A2OUSTR("all");
+ sRet = A2OUSTR("all");
+ break;
case enumXFPageUsageLeft:
- return A2OUSTR("left");
+ sRet = A2OUSTR("left");
+ break;
case enumXFPageUsageRight:
- return A2OUSTR("right");
+ sRet = A2OUSTR("right");
+ break;
case enumXFPageUsageMirror:
- return A2OUSTR("mirrored");
+ sRet = A2OUSTR("mirrored");
+ break;
default:
- return A2OUSTR("mirrored");
+ sRet = A2OUSTR("mirrored");
+ break;
}
- return A2OUSTR("");
+ return sRet;
}
rtl::OUString GetValueType(enumXFValueType type)
{
+ rtl::OUString sRet;
switch(type)
{
case enumXFValueTypeBoolean:
- return A2OUSTR("boolean");
+ sRet = A2OUSTR("boolean");
+ break;
case enumXFValueTypeCurrency:
- return A2OUSTR("currency");
+ sRet = A2OUSTR("currency");
+ break;
case enumXFValueTypeDate:
- return A2OUSTR("date");
+ sRet = A2OUSTR("date");
+ break;
case enumXFValueTypeFloat:
- return A2OUSTR("float");
+ sRet = A2OUSTR("float");
+ break;
case enumXFValueTypePercentage:
- return A2OUSTR("percentage");
+ sRet = A2OUSTR("percentage");
+ break;
case enumXFValueTypeString:
- return A2OUSTR("string");
+ sRet = A2OUSTR("string");
+ break;
case enumXFValueTypeTime:
- return A2OUSTR("time");
+ sRet = A2OUSTR("time");
+ break;
default:
- return A2OUSTR("mirrored");
+ sRet = A2OUSTR("mirrored");
+ break;
}
- return A2OUSTR("");
+ return sRet;
}
rtl::OUString GetColorMode(enumXFColorMode mode)
More information about the Libreoffice-commits
mailing list