[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Apr 1 07:30:02 PDT 2014
sw/qa/unoapi/sw.sce | 6 +++---
sw/source/core/docnode/nodedump.cxx | 8 ++++++++
sw/source/core/unocore/unostyle.cxx | 4 ++--
3 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 1e3c7b854baac2502bed72ff8e3e1b21b507735b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Apr 1 15:54:58 2014 +0200
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
diff --git a/sw/qa/unoapi/sw.sce b/sw/qa/unoapi/sw.sce
index cc6a359..4ea9fab 100644
--- a/sw/qa/unoapi/sw.sce
+++ b/sw/qa/unoapi/sw.sce
@@ -16,10 +16,10 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-# FIXME port to FillAttributes -o sw.CharacterStyle
-# FIXME port to FillAttributes -o sw.ConditionalParagraphStyle
+-o sw.CharacterStyle
+-o sw.ConditionalParagraphStyle
-o sw.PageStyle
-# FIXME port to FillAttributes -o sw.ParagraphStyle
+-o sw.ParagraphStyle
#i111197 -o sw.SwAccessibleDocumentPageView
#i86751 -o sw.SwAccessibleDocumentView
-o sw.SwAccessibleEndnoteView
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 45047ed..1c417c8 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -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
sal_Int32 nValue = 0;
- aRet >>= nValue;
- aRet <<= (sal_Int16)nValue;
+ if (aRet >>= nValue)
+ aRet <<= (sal_Int16)nValue;
}
//UUUU check for needed metric translation
commit 6f8ffc4eed5ff584bc9c9b9c210e7e0c58ccfd9b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Apr 1 15:40:46 2014 +0200
sw doc model xml dump: handle SvxFontHeightItem
Change-Id: I27a9681fdf86a8814be48ba9875202705aa2b014
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 2d0cd2b..d6e1207 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -25,6 +25,7 @@
#include <editeng/charrotateitem.hxx>
#include <editeng/rsiditem.hxx>
#include <editeng/fontitem.hxx>
+#include <editeng/fhgtitem.hxx>
#include <tools/datetimeutils.hxx>
#include <libxml/encoding.h>
@@ -319,6 +320,13 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_CHRATR_FONT: pWhich = "character font"; oValue = OUStringToOString(static_cast<const SvxFontItem*>(pItem)->GetFamilyName(), RTL_TEXTENCODING_UTF8); break;
case RES_CHRATR_BACKGROUND: pWhich = "character background"; break;
case RES_CHRATR_CTL_FONT: pWhich = "character ctl font"; break;
+ case RES_CHRATR_FONTSIZE:
+ {
+ pWhich = "character font size";
+ const SvxFontHeightItem* pFontHeightItem = static_cast<const SvxFontHeightItem*>(pItem);
+ oValue = "nHeight: " + OString::number(pFontHeightItem->GetHeight()) + ", nProp: " + OString::number(pFontHeightItem->GetProp());
+ }
+ break;
}
if (pWhich)
writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich));
More information about the Libreoffice-commits
mailing list