Kaydet (Commit) 7dfc4da8 authored tarafından Luboš Luňák's avatar Luboš Luňák

handle graphic bullets in .docx also when saved as <w:pict>

Change-Id: I7225b4b024c6b7c549d0c9fbf5204df653577bec
üst 829027ab
......@@ -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);
......
......@@ -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; };
......
......@@ -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 ));
......
......@@ -294,6 +294,7 @@ enum PropertyIds
,PROP_RELATIVE_WIDTH
,PROP_IS_WIDTH_RELATIVE
,PROP_GRAPHIC_URL
,PROP_GRAPHIC_BITMAP
};
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier
......
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