summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-03-01 08:39:11 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-03-07 02:37:36 +0100
commitd72145f9307c732ced4a546ac1e5093ec7c1a982 (patch)
tree648cf88d30ba3da260edb22829d8cd8be0c9345e /writerfilter
parent6b39ed0eaffabb6ffe11496d833053c094c72f7b (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')
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx25
-rw-r--r--writerfilter/source/dmapper/NumberingManager.hxx2
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
4 files changed, 14 insertions, 15 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.
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index 339e6d491757..f93269b5b1f9 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -46,7 +46,6 @@ class ListLevel : public PropertyMap
sal_Int32 m_nJC; //LN_JC
sal_Int16 m_nXChFollow; //LN_IXCHFOLLOW
OUString m_sBulletChar;
- OUString m_sGraphicURL;
css::awt::Size m_aGraphicSize;
css::uno::Reference<css::graphic::XGraphic> m_sGraphicBitmap;
sal_Int32 m_nTabstop;
@@ -70,7 +69,6 @@ public:
// Setters for the import
void SetValue( Id nId, sal_Int32 nValue );
void SetBulletChar( const OUString& sValue ) { m_sBulletChar = sValue; };
- void SetGraphicURL( const OUString& sValue ) { m_sGraphicURL = sValue; };
void SetGraphicSize( const css::awt::Size& aValue ) { m_aGraphicSize = aValue; };
void SetGraphicBitmap(css::uno::Reference<css::graphic::XGraphic> const& sValue)
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 6035b617a465..592063a4d312 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -291,7 +291,6 @@ OUString getPropertyName( PropertyIds eId )
case PROP_SHADOW_FORMAT: sName = "ShadowFormat"; break;
case PROP_RELATIVE_WIDTH: sName = "RelativeWidth"; break;
case PROP_IS_WIDTH_RELATIVE: sName = "IsWidthRelative"; break;
- case PROP_GRAPHIC_URL: sName = "GraphicURL"; break;
case PROP_GRAPHIC_BITMAP: sName = "GraphicBitmap"; break;
case PROP_GRAPHIC_SIZE: sName = "GraphicSize"; break;
case PROP_CHAR_SHADING_VALUE: sName = "CharShadingValue"; break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index f69b6531b7db..a3465fe8d98a 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -288,7 +288,6 @@ enum PropertyIds
,PROP_SHADOW_FORMAT
,PROP_RELATIVE_WIDTH
,PROP_IS_WIDTH_RELATIVE
- ,PROP_GRAPHIC_URL
,PROP_GRAPHIC_BITMAP
,PROP_GRAPHIC_SIZE
,PROP_CHAR_SHADING_VALUE