summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-04-26 21:30:39 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-05-02 17:00:36 +0200
commit7dfc4da808bb26d38090f8afb0d742adabe8cedf (patch)
tree65ec6aa3e7f743047e00ba6b3945d9976bfebfc7
parent829027abe3d9c7f0419fbf311dffb31b0b72b028 (diff)
handle graphic bullets in .docx also when saved as <w:pict>
Change-Id: I7225b4b024c6b7c549d0c9fbf5204df653577bec
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx19
-rw-r--r--writerfilter/source/dmapper/NumberingManager.hxx4
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx1
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx1
4 files changed, 23 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 3c6019de5e6a..87ddf75a1fdc 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -278,7 +278,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
sal_Int16 nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC);
if( m_nNFC >= 0)
{
- if (!m_sGraphicURL.isEmpty())
+ if (!m_sGraphicURL.isEmpty() || m_sGraphicBitmap.is())
nNumberFormat = style::NumberingType::BITMAP;
aNumberingProperties.push_back( MAKE_PROPVAL(PROP_NUMBERING_TYPE, nNumberFormat ));
}
@@ -293,6 +293,8 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( )
aNumberingProperties.push_back( MAKE_PROPVAL(PROP_BULLET_CHAR, m_sBulletChar.copy(0,1)));
if (!m_sGraphicURL.isEmpty())
aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_URL, m_sGraphicURL));
+ if (m_sGraphicBitmap.is())
+ aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_BITMAP, m_sGraphicBitmap));
}
aNumberingProperties.push_back( MAKE_PROPVAL( PROP_LISTTAB_STOP_POSITION, m_nTabstop ) );
@@ -931,7 +933,20 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
if (xShape.is())
{
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
- m_pCurrentDefinition->GetCurrentLevel()->SetGraphicURL(xPropertySet->getPropertyValue("GraphicURL").get<OUString>());
+ uno::Reference<beans::XPropertySetInfo> info = xPropertySet->getPropertySetInfo();
+ uno::Sequence<beans::Property> properties = info->getProperties();
+ try
+ {
+ m_pCurrentDefinition->GetCurrentLevel()->SetGraphicURL(xPropertySet->getPropertyValue("GraphicURL").get<OUString>());
+ } catch(const beans::UnknownPropertyException&)
+ {}
+ try
+ {
+ uno::Reference< graphic::XGraphic > gr;
+ xPropertySet->getPropertyValue("Bitmap") >>= gr;
+ m_pCurrentDefinition->GetCurrentLevel()->SetGraphicBitmap( gr );
+ } catch(const beans::UnknownPropertyException&)
+ {}
// Now that we saved the URL of the graphic, remove it from the document.
uno::Reference<lang::XComponent> xShapeComponent(xShape, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index 2a109ff87485..eb23f528786a 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -29,6 +29,7 @@
#include <editeng/numitem.hxx>
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
namespace writerfilter {
namespace dmapper {
@@ -53,6 +54,7 @@ class ListLevel : public PropertyMap
sal_Int16 m_nXChFollow; //LN_IXCHFOLLOW
OUString m_sBulletChar;
OUString m_sGraphicURL;
+ com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > m_sGraphicBitmap;
sal_Int32 m_nTabstop;
boost::shared_ptr< StyleSheetEntry > m_pParaStyle;
bool m_outline;
@@ -81,6 +83,8 @@ public:
void SetValue( Id nId, sal_Int32 nValue );
void SetBulletChar( OUString sValue ) { m_sBulletChar = sValue; };
void SetGraphicURL( OUString sValue ) { m_sGraphicURL = sValue; };
+ void SetGraphicBitmap( com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > sValue )
+ { m_sGraphicBitmap = sValue; }
void SetParaStyle( boost::shared_ptr< StyleSheetEntry > pStyle );
void AddRGBXchNums( OUString sValue ) { m_sRGBXchNums += sValue; };
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 08f3ac20b265..86438b9a6fc3 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -323,6 +323,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
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;
}
::std::pair<PropertyNameMap_t::iterator,bool> aInsertIt =
m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName ));
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index c4f30bfd14f7..3467321903a9 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -294,6 +294,7 @@ enum PropertyIds
,PROP_RELATIVE_WIDTH
,PROP_IS_WIDTH_RELATIVE
,PROP_GRAPHIC_URL
+ ,PROP_GRAPHIC_BITMAP
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier