Kaydet (Commit) 1e3c7b85 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwXStyle::getPropertyValue: don't try to read a float into a sal_Int32

The problem was that for the CharDiffHeight UNO property,
SvxFontHeightItem::QueryValue() put a float to the returned uno::Any.
When we noticed that it's not sal_Int16, we tried to read that into a
sal_Int32 (which failed), and then wrote back the result to the
uno::Any, that's how the result value was 0.

Fix this by checking if reading the uno::Any into a sal_Int32 succeeds.

Change-Id: Ie2269a24fe82ae241940811e7a2f5deaf9f1aeb0
üst 6f8ffc4e
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 . # the License at http://www.apache.org/licenses/LICENSE-2.0 .
# #
# FIXME port to FillAttributes -o sw.CharacterStyle -o sw.CharacterStyle
# FIXME port to FillAttributes -o sw.ConditionalParagraphStyle -o sw.ConditionalParagraphStyle
-o sw.PageStyle -o sw.PageStyle
# FIXME port to FillAttributes -o sw.ParagraphStyle -o sw.ParagraphStyle
#i111197 -o sw.SwAccessibleDocumentPageView #i111197 -o sw.SwAccessibleDocumentPageView
#i86751 -o sw.SwAccessibleDocumentView #i86751 -o sw.SwAccessibleDocumentView
-o sw.SwAccessibleEndnoteView -o sw.SwAccessibleEndnoteView
......
...@@ -2557,8 +2557,8 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, ...@@ -2557,8 +2557,8 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{ {
// since the sfx uint16 item now exports a sal_Int32, we may have to fix this here // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
sal_Int32 nValue = 0; sal_Int32 nValue = 0;
aRet >>= nValue; if (aRet >>= nValue)
aRet <<= (sal_Int16)nValue; aRet <<= (sal_Int16)nValue;
} }
//UUUU check for needed metric translation //UUUU check for needed metric translation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment