summaryrefslogtreecommitdiffstats
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-01-28 18:07:45 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-01-29 15:20:59 +0100
commit81a46fc86a530f028a5bd2f5e52fe0372d50ee38 (patch)
treee42c3775afd4dc5c3ae2d4e1f63ab68a76392548 /svx
parentRelated: fdo#59922 add new unicode blocks, detect newer in future (diff)
downloadcore-81a46fc86a530f028a5bd2f5e52fe0372d50ee38.tar.gz
core-81a46fc86a530f028a5bd2f5e52fe0372d50ee38.zip
SvXMLExport::_ExportStyles: also try to export text gradients
They are not exported automatically, as SvxUnoNameItemTable needs a Which ID, and it's different for drawinglayer and Writer gradients. Change-Id: I5dd7d828b1f0e577e26510e3c5ca74386d000f16
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/unofill.hxx1
-rw-r--r--svx/source/unodraw/unogtabl.cxx24
2 files changed, 22 insertions, 3 deletions
diff --git a/svx/inc/svx/unofill.hxx b/svx/inc/svx/unofill.hxx
index 523905a1d97a..75c5237fb14d 100644
--- a/svx/inc/svx/unofill.hxx
+++ b/svx/inc/svx/unofill.hxx
@@ -26,6 +26,7 @@
class SdrModel;
SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoGradientTable_createInstance( SdrModel* pModel );
+SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoTextGradientTable_createInstance( SdrModel* pModel, sal_uInt16 nWhich );
SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoHatchTable_createInstance( SdrModel* pModel );
SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoBitmapTable_createInstance( SdrModel* pModel );
SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxUnoTransGradientTable_createInstance( SdrModel* pModel );
diff --git a/svx/source/unodraw/unogtabl.cxx b/svx/source/unodraw/unogtabl.cxx
index deb2e1d2d656..0cabe7a26943 100644
--- a/svx/source/unodraw/unogtabl.cxx
+++ b/svx/source/unodraw/unogtabl.cxx
@@ -35,8 +35,10 @@ using namespace ::cppu;
class SvxUnoGradientTable : public SvxUnoNameItemTable
{
+ bool m_bTextWhich;
public:
SvxUnoGradientTable( SdrModel* pModel ) throw();
+ SvxUnoGradientTable( SdrModel* pModel, sal_uInt16 nWhich ) throw();
virtual ~SvxUnoGradientTable() throw();
virtual NameOrIndex* createItem() const throw();
@@ -50,7 +52,12 @@ public:
};
SvxUnoGradientTable::SvxUnoGradientTable( SdrModel* pModel ) throw()
- : SvxUnoNameItemTable( pModel, XATTR_FILLGRADIENT, MID_FILLGRADIENT )
+ : SvxUnoNameItemTable( pModel, XATTR_FILLGRADIENT, MID_FILLGRADIENT ), m_bTextWhich(false)
+{
+}
+
+SvxUnoGradientTable::SvxUnoGradientTable( SdrModel* pModel, sal_uInt16 nWhich ) throw()
+ : SvxUnoNameItemTable( pModel, nWhich, MID_FILLGRADIENT ), m_bTextWhich(true)
{
}
@@ -60,14 +67,20 @@ SvxUnoGradientTable::~SvxUnoGradientTable() throw()
OUString SAL_CALL SvxUnoGradientTable::getImplementationName() throw( uno::RuntimeException )
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoGradientTable") );
+ if (m_bTextWhich)
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoTextGradientTable") );
+ else
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoGradientTable") );
}
uno::Sequence< OUString > SAL_CALL SvxUnoGradientTable::getSupportedServiceNames( )
throw( uno::RuntimeException )
{
uno::Sequence< OUString > aSNS( 1 );
- aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable" ));
+ if (m_bTextWhich)
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GradientTable" ));
+ else
+ aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable" ));
return aSNS;
}
@@ -93,6 +106,11 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoGradientTable_createInstance( S
return *new SvxUnoGradientTable(pModel);
}
+uno::Reference< uno::XInterface > SAL_CALL SvxUnoTextGradientTable_createInstance( SdrModel* pModel, sal_uInt16 nWhich )
+{
+ return *new SvxUnoGradientTable(pModel, nWhich);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */