completely remove MID_GRAFURL, replace with MID_BITMAP

Change-Id: I39b055760320abb2575958d525b4db3185a11d4a
Reviewed-on: https://gerrit.libreoffice.org/50990
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2018-03-09 16:39:29 +09:00 committed by Tomaž Vajngerl
parent 78a434f331
commit 9900c6bd96
7 changed files with 6 additions and 25 deletions

View file

@ -35,7 +35,6 @@
//NameOrIndex
#define MID_NAME 16
#define MID_GRAFURL 32
// SvxPageModelItem
#define MID_AUTO 1

View file

@ -1032,7 +1032,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
if( const XFillBitmapItem* pBmpItem = rEscherFmt.mxItemSet->GetItem<XFillBitmapItem>( XATTR_FILLBITMAP, false ) )
{
uno::Any aBitmapAny;
if( pBmpItem->QueryValue( aBitmapAny, MID_GRAFURL ) )
if (pBmpItem->QueryValue(aBitmapAny, MID_BITMAP))
{
OUString aBmpName = rBitmapTable.InsertObject( aBitmapAny );
if( !aBmpName.isEmpty() )

View file

@ -20,7 +20,6 @@
struct XFillBitmap
{
String Name MID_NAME;
String GraphicsURL MID_GRAFURL;
// com::sun::star::awt::XBitmap
};
item XFillBitmap XFillBitmapItem;

View file

@ -636,7 +636,6 @@
#define UNO_NAME_HEADER_FILLBACKGROUND "HeaderFillBackground"
#define UNO_NAME_HEADER_FILLBITMAP "HeaderFillBitmap"
#define UNO_NAME_HEADER_FILLBITMAPNAME "HeaderFillBitmapName"
#define UNO_NAME_HEADER_FILLBITMAPURL "HeaderFillBitmapURL"
#define UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT "HeaderFillGradientStepCount"
#define UNO_NAME_HEADER_FILLGRADIENT "HeaderFillGradient"
#define UNO_NAME_HEADER_FILLGRADIENTNAME "HeaderFillGradientName"
@ -663,7 +662,6 @@
#define UNO_NAME_FOOTER_FILLBACKGROUND "FooterFillBackground"
#define UNO_NAME_FOOTER_FILLBITMAP "FooterFillBitmap"
#define UNO_NAME_FOOTER_FILLBITMAPNAME "FooterFillBitmapName"
#define UNO_NAME_FOOTER_FILLBITMAPURL "FooterFillBitmapURL"
#define UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT "FooterFillGradientStepCount"
#define UNO_NAME_FOOTER_FILLGRADIENT "FooterFillGradient"
#define UNO_NAME_FOOTER_FILLGRADIENTNAME "FooterFillGradientName"

View file

@ -236,7 +236,6 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
// XFillBitmapItem: three possible slots supported in UNO API
const uno::Any* pXFillBitmapItem = nullptr; GetProperty(XATTR_FILLBITMAP, MID_BITMAP, pXFillBitmapItem);
const uno::Any* pXFillBitmapNameItem = nullptr; GetProperty(XATTR_FILLBITMAP, MID_NAME, pXFillBitmapNameItem);
const uno::Any* pXFillBitmapURLItem = nullptr; GetProperty(XATTR_FILLBITMAP, MID_GRAFURL, pXFillBitmapURLItem);
const uno::Any* pXFillTransparenceItem = nullptr; GetProperty(XATTR_FILLTRANSPARENCE, 0, pXFillTransparenceItem);
const uno::Any* pXGradientStepCountItem = nullptr; GetProperty(XATTR_GRADIENTSTEPCOUNT, 0, pXGradientStepCountItem);
@ -268,7 +267,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
pXFillColorItem ||
pXFillGradientItem || pXFillGradientNameItem ||
pXFillHatchItem || pXFillHatchNameItem ||
pXFillBitmapItem || pXFillBitmapNameItem || pXFillBitmapURLItem ||
pXFillBitmapItem || pXFillBitmapNameItem ||
pXFillTransparenceItem ||
pXGradientStepCountItem ||
pXFillBmpPosItem ||
@ -435,7 +434,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
}
}
if(pXFillBitmapItem || pXFillBitmapNameItem || pXFillBitmapURLItem)
if (pXFillBitmapItem || pXFillBitmapNameItem)
{
if(pXFillBitmapItem)
{
@ -457,15 +456,6 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
bRet &= SvxShape::SetFillAttribute(XATTR_FILLBITMAP, aTempName, rToSet);
}
if(pXFillBitmapURLItem)
{
const Graphic aNullGraphic;
XFillBitmapItem aXFillBitmapItem(aNullGraphic);
aXFillBitmapItem.PutValue(*pXFillBitmapURLItem, MID_GRAFURL);
rToSet.Put(aXFillBitmapItem);
}
}
if (pXFillTransparenceItem)
@ -1789,9 +1779,8 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
}
break;
}
case MID_GRAFURL:
case MID_BITMAP:
{
// Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
switch(pEntry->nWID)
{
case XATTR_FILLBITMAP:

View file

@ -622,7 +622,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPageStylePropertyMa
{ OUString(UNO_NAME_HEADER_FILLBACKGROUND), XATTR_FILLBACKGROUND, cppu::UnoType<bool>::get(), 0, 0},
{ OUString(UNO_NAME_HEADER_FILLBITMAP), XATTR_FILLBITMAP, cppu::UnoType<css::awt::XBitmap>::get(), 0, MID_BITMAP},
{ OUString(UNO_NAME_HEADER_FILLBITMAPNAME), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_NAME },
{ OUString(UNO_NAME_HEADER_FILLBITMAPURL), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_GRAFURL },
{ OUString(UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, cppu::UnoType<sal_Int16>::get(), 0, 0},
{ OUString(UNO_NAME_HEADER_FILLGRADIENT), XATTR_FILLGRADIENT, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT},
{ OUString(UNO_NAME_HEADER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, cppu::UnoType<OUString>::get(), 0, MID_NAME },
@ -650,7 +649,6 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPageStylePropertyMa
{ OUString(UNO_NAME_FOOTER_FILLBACKGROUND), XATTR_FILLBACKGROUND, cppu::UnoType<bool>::get(), 0, 0},
{ OUString(UNO_NAME_FOOTER_FILLBITMAP), XATTR_FILLBITMAP, cppu::UnoType<css::awt::XBitmap>::get(), 0, MID_BITMAP},
{ OUString(UNO_NAME_FOOTER_FILLBITMAPNAME), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_NAME },
{ OUString(UNO_NAME_FOOTER_FILLBITMAPURL), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_GRAFURL },
{ OUString(UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, cppu::UnoType<sal_Int16>::get(), 0, 0},
{ OUString(UNO_NAME_FOOTER_FILLGRADIENT), XATTR_FILLGRADIENT, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT},
{ OUString(UNO_NAME_FOOTER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, cppu::UnoType<OUString>::get(), 0, MID_NAME },

View file

@ -1623,11 +1623,10 @@ void SwXStyle::SetPropertyValue<sal_uInt16(XATTR_FILLGRADIENT)>(const SfxItemPro
throw lang::IllegalArgumentException();
SvxShape::SetFillAttribute(rEntry.nWID, aValue.get<OUString>(), rStyleSet);
}
else if(MID_GRAFURL == nMemberId)
else if(MID_BITMAP == nMemberId)
{
if(sal_uInt16(XATTR_FILLBITMAP) == rEntry.nWID)
{
// Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
const Graphic aNullGraphic;
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
XFillBitmapItem aXFillBitmapItem(aNullGraphic);
@ -3615,11 +3614,10 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
SvxShape::SetFillAttribute(pEntry->nWID, aTempName, aSet);
bDone = true;
}
else if(MID_GRAFURL == nMemberId)
else if (MID_BITMAP == nMemberId)
{
if(XATTR_FILLBITMAP == pEntry->nWID)
{
// Bitmap also has the MID_GRAFURL mode where a Bitmap URL is used
const Graphic aNullGraphic;
XFillBitmapItem aXFillBitmapItem(aNullGraphic);