Kaydet (Commit) 84f30b34 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

[API-CHANGE] change to GraphicBitmap prop. for NumberingLevel

To make it consistent, change "Graphic" property (added during
image handling rework) to "GraphicBitmap" in style::NumberingLevel,
which is already used in text::NumberingLevel. Both of them are
accessors for the graphic of bitmap bullets.

Change-Id: I70f7bccd80fa9949778c49e23de583c6fb32a796
Reviewed-on: https://gerrit.libreoffice.org/54492Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 3a1f7ba6
......@@ -67,8 +67,8 @@ published service NumberingLevel
Note the new behaviour since it this was deprecated:
This property can only be set and only external URLs are
supported (no more vnd.sun.star.GraphicObject scheme). When an
URL is set, then it will load the graphic and set the Graphic
property.
URL is set, then it will load the graphic and set the
GraphicBitmap property.
*/
[property] string GraphicURL;
......@@ -76,11 +76,11 @@ published service NumberingLevel
*/
[property] short StartWith;
/** This is the graphic file to use as a symbol.
/** This is the graphic bitmap to use as a symbol.
@since LibreOffice 6.1
*/
[optional, property] com::sun::star::graphic::XGraphic Graphic;
[optional, property] com::sun::star::awt::XBitmap GraphicBitmap;
};
......
......@@ -603,7 +603,7 @@ DECLARE_OOXMLEXPORT_TEST(testI120928, "i120928.docx")
uno::Sequence<beans::PropertyValue> aProps;
xLevels->getByIndex(0) >>= aProps; // 1st level
uno::Reference<graphic::XGraphic> xGraphic;
uno::Reference<awt::XBitmap> xBitmap;
sal_Int16 nNumberingType = -1;
for (int i = 0; i < aProps.getLength(); ++i)
......@@ -612,11 +612,11 @@ DECLARE_OOXMLEXPORT_TEST(testI120928, "i120928.docx")
if (rProp.Name == "NumberingType")
nNumberingType = rProp.Value.get<sal_Int16>();
else if (rProp.Name == "Graphic")
xGraphic = rProp.Value.get<uno::Reference<graphic::XGraphic>>();
else if (rProp.Name == "GraphicBitmap")
xBitmap = rProp.Value.get<uno::Reference<awt::XBitmap>>();
}
CPPUNIT_ASSERT_EQUAL(style::NumberingType::BITMAP, nNumberingType);
CPPUNIT_ASSERT(xGraphic.is());
CPPUNIT_ASSERT(xBitmap.is());
}
DECLARE_OOXMLEXPORT_TEST(testFdo64826, "fdo64826.docx")
......
......@@ -10,6 +10,7 @@
#include <swmodeltestbase.hxx>
#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
......@@ -552,7 +553,7 @@ DECLARE_RTFEXPORT_TEST(testI120928, "i120928.rtf")
uno::Sequence<beans::PropertyValue> aProps;
xLevels->getByIndex(0) >>= aProps; // 1st level
uno::Reference<graphic::XGraphic> xGraphic;
uno::Reference<awt::XBitmap> xBitmap;
sal_Int16 nNumberingType = -1;
for (int i = 0; i < aProps.getLength(); ++i)
......@@ -561,11 +562,11 @@ DECLARE_RTFEXPORT_TEST(testI120928, "i120928.rtf")
if (rProp.Name == "NumberingType")
nNumberingType = rProp.Value.get<sal_Int16>();
else if (rProp.Name == "Graphic")
xGraphic = rProp.Value.get<uno::Reference<graphic::XGraphic>>();
else if (rProp.Name == "GraphicBitmap")
xBitmap = rProp.Value.get<uno::Reference<awt::XBitmap>>();
}
CPPUNIT_ASSERT_EQUAL(style::NumberingType::BITMAP, nNumberingType);
CPPUNIT_ASSERT(xGraphic.is());
CPPUNIT_ASSERT(xBitmap.is());
}
DECLARE_RTFEXPORT_TEST(testBookmark, "bookmark.rtf")
......
......@@ -1431,9 +1431,6 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat
const Graphic* pGraphic = pBrush ? pBrush->GetGraphic() : nullptr;
if (pGraphic)
{
uno::Reference<graphic::XGraphic> xGraphic(pGraphic->GetXGraphic());
//GraphicURL
aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC, xGraphic));
//GraphicBitmap
uno::Reference<awt::XBitmap> xBitmap(pGraphic->GetXGraphic(), uno::UNO_QUERY);
aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_BITMAP, xBitmap));
......
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