diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-03-01 08:39:11 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-03-07 02:37:36 +0100 |
commit | d72145f9307c732ced4a546ac1e5093ec7c1a982 (patch) | |
tree | 648cf88d30ba3da260edb22829d8cd8be0c9345e /writerfilter/source/dmapper/NumberingManager.cxx | |
parent | 6b39ed0eaffabb6ffe11496d833053c094c72f7b (diff) |
Move BackGraphicURL property & friends to BackGraphic + fixes
This moves BackGraphicURL, HeaderGraphicURL, FooterGraphicURL and
ParaBackGraphicURL properties to BackGraphic, HeaderBackGraphic,
FooterBackGraphic and ParaBackGraphic. With this the property type
changes from String to XGraphic.
This change also fixes a bunch of test failures, changes the tests
to use the new properties and the correct type, changes the import
and export filters like xmloff and oox, to make the tests happy.
Change-Id: Ie66097514203c6dc36ab27420faf265322e9279e
Reviewed-on: https://gerrit.libreoffice.org/50760
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'writerfilter/source/dmapper/NumberingManager.cxx')
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index b406c44a6152..71e839ec32e7 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/PositionAndSpaceMode.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> #include <osl/diagnose.h> #include <rtl/ustring.hxx> @@ -241,7 +242,7 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults sal_Int16 nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC); if( m_nNFC >= 0) { - if (!m_sGraphicURL.isEmpty() || m_sGraphicBitmap.is()) + if (m_sGraphicBitmap.is()) nNumberFormat = style::NumberingType::BITMAP; else if (m_sBulletChar.isEmpty() && nNumberFormat != style::NumberingType::CHAR_SPECIAL) // w:lvlText is empty, that means no numbering in Word. @@ -268,8 +269,6 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults aNumberingProperties.push_back(lcl_makePropVal<sal_Unicode>(PROP_BULLET_CHAR, 0)); } } - if (!m_sGraphicURL.isEmpty()) - aNumberingProperties.push_back(lcl_makePropVal(PROP_GRAPHIC_URL, m_sGraphicURL)); if (m_sGraphicBitmap.is()) { aNumberingProperties.push_back(lcl_makePropVal(PROP_GRAPHIC_BITMAP, m_sGraphicBitmap)); @@ -879,17 +878,21 @@ void ListsManager::lcl_sprm( Sprm& rSprm ) uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); try { - uno::Any aAny = xPropertySet->getPropertyValue("GraphicURL"); - if (aAny.has<OUString>() && pCurrentLevel) - pCurrentLevel->SetGraphicURL(aAny.get<OUString>()); - } catch(const beans::UnknownPropertyException&) + uno::Any aAny = xPropertySet->getPropertyValue("GraphicBitmap"); + if (aAny.has<uno::Reference<graphic::XGraphic>>() && pCurrentLevel) + pCurrentLevel->SetGraphicBitmap(aAny.get<uno::Reference<graphic::XGraphic>>()); + } + catch (const beans::UnknownPropertyException&) {} + try { - uno::Reference< graphic::XGraphic > gr; - xPropertySet->getPropertyValue("Bitmap") >>= gr; - pCurrentLevel->SetGraphicBitmap( gr ); - } catch(const beans::UnknownPropertyException&) + uno::Any aAny = xPropertySet->getPropertyValue("Bitmap"); + if (aAny.has<uno::Reference<graphic::XGraphic>>() && pCurrentLevel) + pCurrentLevel->SetGraphicBitmap(aAny.get<uno::Reference<graphic::XGraphic>>()); + + } + catch (const beans::UnknownPropertyException&) {} // Respect only the aspect ratio of the picture, not its size. |